Consider the following classes Which of the following are le

Consider the following classes:

Which of the following are legal statements?

There can be more then one answer

Which of the following are legal statements?

  1. SUV s = new SUV();
  2. Car c = new SUV();
  3. Vehicle v = new SUV();
  4. SUV s = new Car();
  5. Vehicle v = new Car();
  6. Car c = new Vehicle();

There can be more then one answer

Solution

Posible Answers:
       SUV s = new SUV();
       Car c = new SUV();
       Vehicle v = new SUV();
       Vehicle v1 = new Car();
Incorrect Answers: cannot type cast
       SUV s1 = new Car();
       Car c1 = new Vehicle();

Consider the following classes: Which of the following are legal statements? There can be more then one answer Which of the following are legal statements? SUV

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site