public String toString() {
for(int i = 0; i<items.length; i++) { //i++ is considered "dead code"
return "Name: " + items[i].getName() + ", Is carn? " + items[i].getVeg() + ", Pop: " + items[i].getPop();
}
return null;
}
This method should go through an array and return the name, veg and pop. Works for items[0] but not further.