A method eat()
uses a parameter of type Food
, while Food
is a generic class:
class Food<T> {
T type;
...
}
class Human {
public void eat Food(Food food) {
// eat, eat, and eat, however it has nothing to do with T
}
}
The question is, should I declare Food<?>
instead of Food
in eat
's parameter? Are there any difference while the method eat
doesn't care and use anything related with T
?