Insert the missing code in the following code fragment. This fragment is intende
ID: 3695434 • Letter: I
Question
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 setVesselLength(double vesselLength){ . . . }
. . .
}
pulbic class SpeedBoat extends Vessel{
. . .
public SpeedBoat(){
___________________;
}
. .
}
SpeedBoat.setVesselLength(26.0);
Vessel.setVesselLength(26.0);
that.setVesselLength(26.0);
setVesselLength(26.0);
Which of the following indicates that a class named ClassA class is a superclass of the ClassB class?
public class ClassB extends ClassA
public class ClassB implements ClassA
public class ClassA extends ClassB
public class ClassA implements ClassB
The Programmer class can call the setDepartment method of the Employee class.
The Employee class can call the setProjectName method.
The Programmer class overrides the setDepartment method.
The Programmer class can call the setDepartment method of the Programmer class.
The ____ reserved word in a method definition ensures that subclasses cannot override this method.
abstract
anonymous
final
static
a.SpeedBoat.setVesselLength(26.0);
b.Vessel.setVesselLength(26.0);
c.that.setVesselLength(26.0);
d.setVesselLength(26.0);
Explanation / Answer
Q1) D <----setVesselLength(26.0);
Q2) A <---public class ClassB extends ClassA
Q3) B <----The Employee class can call the setProjectName method.
Q4) D
Q5) C <---- Final