Example #1
0
 public Prodotto getMassimo() {
   Prodotto massimo = elenco.get(0);
   for (int i = 0; i < elenco.size(); i++) {
     if (elenco.get(i).getPrezzo() > massimo.getPrezzo()) {
       massimo = elenco.get(i);
     }
   }
   return massimo;
 }
Example #2
0
  public boolean acquista(int q) {
    if (q < super.getQuantità()) {
      super.setQuantità(super.getQuantità() - q);
      return true;

    } else return false;
  }