I have a class like this
public class SellableItems {
private int id;
private String name;
private double price;
public SellableItems() {
}
}
// getters and setters here
}
Now lets say I have created some objects and put them into an ArrayList, which looks like this
List<SellableItems> table1 = Main.readFromTable1();
Then goes my question. How do calculate the sum (the price) of the ArrayList?
Table1. As you can see, even the SO thinks it's a type and is highlighting it teal.