GRADED A+ LATEST UPDATE.
1) A class that represents the most general entity in an
inheritance hierarchy is called a/an ____.
a) Default class.
b) Superclass.
c) Subclass.
d) Inheritance class. ANS >>> b) Superclass.
2) A class that represents a more specific entity in an
inheritance hierarchy is called a/an ____.
a) Default class
b) Superclass
c) Subclass.
d) Inheritance class ANS >>> c) Subclass
,3) You are creating a class inheritance hierarchy about motor
vehicles that will contain classes named Vehicle, Auto, and
Motorcycle. Which of the following statements is correct?
a) Vehicle should be the default class, while Auto and
Motorcycle should be the subclasses.
b) Vehicle should be the superclass, while Auto and Motorcycle
should be the subclasses.
c) Vehicle should be the subclass, while Auto and Motorcycle
should be the superclasses.
d) Vehicle should be the subclass, while Auto and Motorcycle
should be the default classes ANS >>> b) Vehicle should be the
superclass, while Auto and Motorcycle should be the subclasses
4) Which of the following statements about inheritance is
correct?
a) You can always use a superclass object in place of a subclass
object.
b) You can always use a subclass object in place of a superclass
object.
c) A superclass inherits data and behaviour from a subclass.
,d) A superclass inherits only behaviour from a subclass. ANS
>>> b) You can always use a subclass object in place of a
superclass object
5) Insert the missing code in the following code fragment. This
fragment is intended to call the Vehicle class's method.
public class Vehicle
{
...
public void > b (double number Axles)
{
...
}
}
public class Motorcycle extends Vehicle
{
...
public Motorcycle ()
{
_______________;
, }
}
a) Motorcycle ((2.0);
b) Motorcycle ((2.0);
c) Motorcycle ((2.0);
d) Motorcycle ((2.0); ANS >>> d) Motorcycle ((2.0);
6) Insert the missing code in the following code fragment. This
fragment is intended to call the Vessel class's method.
public class Vessel
{
...
public void set Vessel Class (double vessel Length)
{
...
}
}
public class Speedboat extends Vessel