0

How to use more than one parameters in method in java class?

i try put name and food two variable in parameter in eat() method but i dont how to give them input because there are two variable in parameter in method eat(). Please HELP

1st Oct 2017, 4:18 AM
Gaurav Nagar
Gaurav Nagar - avatar
1 Réponse
+ 1
void eat(Food food, EatingMode mode) {...} To call it just use rabbit.eat(carrot,EatingMode.FAST)
1st Oct 2017, 4:47 AM
1of3
1of3 - avatar