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 java language 2. Write an enum type Food, whose constants (APPLE, BANANA,

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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!