dimanche 19 février 2017

How do I fix this if statement in Java?

This is the if statement that is giving me trouble. Eclipse keeps saying it's wrong and I don't understand how to fix it with the suggestions it gives.

void eat(Food meal) {
    if(meal == Grass) {

    }
}

For reference this is the class it's in

public class Dolphin extends Animal {

Dolphin()
{
    super();
}
}

It should be noted Grass is a class that extends another class called Food

Aucun commentaire:

Enregistrer un commentaire