Question: 1 . Create an Interface Edible that has two methods: abstract method howToEat ( ) and default method howToCook ( ) both return a String.

1. Create an Interface Edible that has two methods: abstract method howToEat() and default method howToCook()
both return a String. ................................................................................................................................................................1
2. Create classes Sushi and Soup that both has at least one unique instance data field and an instance method (choose
the data field and its type yourself).........................................................................................................................................1
3. Add getters, setters and at least two constructors to both classes. ...................................................................................1
4. Add toString() method to both classes. ...............................................................................................................................2
5. Both classes should implement the Edible Interface........................................................................................................... 2
6. Create two instances of Sushi and two instances of Soup and test all available functionality (all their methods). Create
an array of size 4 and add all of these into this array. ..

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 Programming Questions!