Question: i need solution for java language Part 1 Coding An inheritance principle is used to explore and implement the Consumable interface and its related classes.


Part 1 Coding An inheritance principle is used to explore and implement the Consumable interface and its related classes. The UML diagram ie remuilidan halinu. Part 1.1. Implement the Interface Consumable strictly according to the UML above. a. The displayNutritionalvalue () method should print the Basic nutritional information not specified. b. Add comments to the method. Part 1.2. Implement the abstract class Food strictly according to the UML above. a. Use appropriate access modifiers. b. No method should have any empty body (unless they are abstract) Part 1.3. Write classes Fruit and Vegetable based on the UML diagram above. a. Use appropriate access modifiers. b. Implement all required data fleids and methods. c. Make sure all abstract methods implemented (if appropriate) d. At least one of the classes should implement the displayNutritionalValue () method. 1 e. The displayNutritionalValue () method should call nutritioninfo () method to provide more details about the Consumable object. f. No method should have any empty body (unless they are abstract) Part 1.4. Write the main() method in a TestFood class having the following: a. Create an array of two Consumable objects. b. The First object is a Fruit of your choice with any country of origin and specified fields (of your choice). c. The Second object is a Vegetable of your choice with properties of your choice. d. Call method displayNutritionalValue on both objects that you just created
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
