Question: Consider the following code snippet: public class Vessel { private String manufacturer; . . . public void setVesselClass ( double engineRPM ) { . .
Consider the following code snippet:
public class Vessel
private String manufacturer;
public void setVesselClassdouble engineRPM
If a Speedboat class is created as a subclass of the Vessel class, which of the following statements is correct?
Question options:
A Speedboat object inherits and can directly use both the instance variable manufacturer and the method setVesselClass.
A Speedboat object inherits and can directly use the instance variable manufacturer but not the method setVesselClass.
A Speedboat object inherits but cannot directly use either the instance variable manufacturer or the method setVesselClass.
A Speedboat object inherits and can directly use the method setVesselClass but cannot directly use the instance variable manufacturer.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
