Question: 25. [6 marks] Add proper class and interface definitions to make the following code compile. Your design must satisfy the following constraints: (i) Human and

 25. [6 marks] Add proper class and interface definitions to make

25. [6 marks] Add proper class and interface definitions to make the following code compile. Your design must satisfy the following constraints: (i) Human and SuperHero must be defined as classes; (ii) all other undefined types must NOT be defined as classes; (iii) the inheritance structure that you write must have at most 2 levels (the object class is not counted as a level of the inheritance; you only need to consider the classes and interfaces used in this question). Note that the bodies of methods fly, transform and fight can be left empty and the return types are void. There should be NO statements inside the methods. public class Adventure f public static void demoFly (CanFly flyer) f flyer.fly) public static void demoTransform (CanTransform transformer) transformer.transform); public static void demoFight (Human human) human.fight); public static void main (String args []) SuperHero ironman -new SuperHero (); demoFly (ironman); demoTransform (ironman); demoFight (ironman) 25. [6 marks] Add proper class and interface definitions to make the following code compile. Your design must satisfy the following constraints: (i) Human and SuperHero must be defined as classes; (ii) all other undefined types must NOT be defined as classes; (iii) the inheritance structure that you write must have at most 2 levels (the object class is not counted as a level of the inheritance; you only need to consider the classes and interfaces used in this question). Note that the bodies of methods fly, transform and fight can be left empty and the return types are void. There should be NO statements inside the methods. public class Adventure f public static void demoFly (CanFly flyer) f flyer.fly) public static void demoTransform (CanTransform transformer) transformer.transform); public static void demoFight (Human human) human.fight); public static void main (String args []) SuperHero ironman -new SuperHero (); demoFly (ironman); demoTransform (ironman); demoFight (ironman)

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!