Question: Question 1 (Multiple Choice Worth 4 points) Consider the following code: public class one { //implementation not shown } public class Two extends one f



Question 1 (Multiple Choice Worth 4 points) Consider the following code: public class one \{ //implementation not shown \} public class Two extends one f //implementation not shown } public class Three extends one \{ //implementation not shown Which of the following statements is true? I. Both Two and three inherit from one. II. Both Two and Three have one as their direct superclass. III. Three is a subclass of Two. I only III only I and II only I and III only I,II, and III Question 2 (Multiple Choice Worth 4 points) Which of the following statements is true? I. A class has only one direct super class. II. A class can have only one subclass. III. A class can only extend one class. I only II only III only I and II only I and III only Question 3(Multiple Choice Worth 4 points) Referring to the constructor of an extended class, where is the call to super located? After instance variables are assigned Anywhere within the body In the first statement In the last statement Within the header Question 4(Multiple Choice Worth 4 points) If class one is extended by class Two, what is the relationship of class one to class Two? A class hierarchy A derived class A direct superclass A subclass An inherited class Question 5 (Multiple Choice Worth 4 points) Consider the following partial class declarations for the Triangle and Righttriangle What code should replace ? super () ; super (31,s2); super (side1, side2, side3); super (s1, Math. sqrt (Math.pow (31,2)+Math.pow(32,2))); super (s1, s2, Math.sqrt(Math.pow (s1,2)+Math. pow (s2,2)))
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
