I\'m doing the MOOC java course, and I\'m stuck on exercise 76. Whenever I submit the answer it tells me to print each meal to a seperate line. How would I go about doing this?<
import java.util.ArrayList;
public class Menu {
private ArrayList meals;
public Menu() {
this.meals = new ArrayList();
}
public void addMeal(String meal) {
if (!meals.contains(meal)) {
meals.add(meal);
}
}
public void printMeals() {
if (meals.isEmpty()){
System.out.println("No Meal Object Found !");
return;
}
for(String meal : meals) {
System.out.println(meal);
}
}
public void clearMenu(){
meals.removeAll(meals);
}
}