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

1 Expert Approved Answer
Step: 1 Unlock

The following statements are marked as legal ... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Building Java Programs A Back to Basics Approach Questions!