Adding elements to an ArrayList
* Calculates the gross waste emission
public void calcGrossWasteEmission()
// gross waste emission equals CO2 generated by individual in household times number of people
household.add(1018 * household.get(0)); // ERROR: Operator * cannot be applied to int, java.lang.Object
Desired solution is to be able to add an element to ArrayList household! :)
Type for household Object
The type of household is an ArrayList object.
private ArrayList household;
Also changing the ArrayList to Integer won't allow me to add bool type to the list. I'm required to use an array with int and bool elements. Is another solution possible?