I have simple class:
public class Item {
private double price;
private String name;
public double getPrice() {return Price;}
}
and I have some diffrent objects of Item in the basket:
ArrayList basket = new ArrayList();
basket.add(newItem);
I would like to use something like that to get price:
basket.get(0).getPrice()
basket.get(1).getPrice()
Of course it doesn't work.