I want to subtract the Value of food from the value of hunger but hunger is not allowed to ge below 0. How would I achieve that ? Also I code in Java
public void eat(Food food) {
if (this.hunger > 0 && food.getTyp() == "Dogfood") {
hunger = hunger - food.getVolume();
}
}