I'm trying to create a getCalories method in which I have to return a String together with an integer but I'm getting an error saying that one cannot be converted to another. How do I make this work?
package task14;
import java.util.ArrayList;
public class Meal {
ArrayList<Ingredient> ingredient = new ArrayList<Ingredient>();
public Meal() {};
public Meal(ArrayList<Ingredient> ingredient) {
this.ingredient = ingredient;
}
**public int getCalories() {
return "This meal has" + Ingredient.numberOfCalories;
}**
public String toString() {
return ingredient.toString();
}
}