Question: java code Question 4: Interfaces (10 points) Create a Java Project called InterfaceDemo and do the following: - Lecture slides show an example of Edible
Question 4: Interfaces (10 points) Create a Java Project called "InterfaceDemo" and do the following: - Lecture slides show an example of Edible Interface. Create the same interface inside your Java Project. - Additionally create a default method of your choice to the "Edible" interface. - Create a Java class called "Vegetable" and two child classes for this class- "Broccoli" and "Potato" inside this class, - Implement the "Edible" interface for the parent class "Vegetable" and then implement the interface methods accordingly. - Create an object for each of the classes and call the interface method using the objects respectively
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
