Question: Java question b. s wrong with the following code for interface? What should be changed to make a valid interface for objects that have colors?
b. s wrong with the following code for interface? What should be changed to make a valid interface for objects that have colors? public interface Colored private Color color; public color getColor() return colori Consider the following classes: public class Vehicle public class car extends Vehicle implements public class suv extends Car. c. Speed (...) Which of the following are legal statements? i. ii. Vehicle v = new Car(); Vehicle v = new SUV ( ); iii. Car c = new SUV(); iv. SUV s = new SUV ( ); SUV s = new Car(); Car c = new Vehicle(); v. vi. vii.Speed s new Car() viii. speed s = new SUV ( )
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
