I am trying to iterate through an ArrayList myWaste, of waste objects.
Some of these waste objects are of type "packaging", from the Packaging class, and the objects of type "packaging" need to be counted, and the count needs to be returned.
I have tried with a for each loop but I am not having much luck:
int count = 0;
for (Waste packaging : myWaste){
count += 1;
}
return count;