Question: Consider the following classes: public class Vehicle {...} public class Car extends Vehicle {...} public class SUV extends Car {...} Which of the following are
Consider the following classes:
public class Vehicle {...}
public class Car extends Vehicle {...}
public class SUV extends Car {...}
Which of the following are legal statements?
a. Vehicle v = new Car();
b. Vehicle v = new SUV();
c. Car c = new SUV();
d. SUV s = new SUV();
e. SUV s = new Car();
f. Car c = new Vehicle();
Step by Step Solution
3.39 Rating (174 Votes )
There are 3 Steps involved in it
The following statements are marked as legal ... View full answer
Get step-by-step solutions from verified subject matter experts
