Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started