Question: java language 2. Write an enum type Food, whose constants (APPLE, BANANA, CARROT) take two parameters the type (vegetable or fruit), and number of calories.
java language 
2. Write an enum type Food, whose constants (APPLE, BANANA, CARROT) take two parameters the type (vegetable or fruit), and number of calories. Write a program to test the Food enum so that it displays the enum names and their information. OUTPUT: APPLE Fruit 116 BANANA Fruit 89 CARROT Vegetable 41
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
