Question: Consider the following code and answer the following question / / Interface interface Engine { void start ( ) ; void stop ( ) ;
Consider the following code and answer the following question
Interface
interface Engine
void start;
void stop;
abstract class Vehicle
private Engine engine;
public VehicleEngine engine
this.engine engine;
public void startEngine
engine.start;
public void stopEngine
engine.stop;
Other common vehicle methods
class Car extends Vehicle
private String model;
public CarString model, Engine engine
superengine;
this.model model;
Carspecific methods
class Bike extends Vehicle
private String type;
public BikeString type, Engine engine
superengine;
this.type type;
Bikespecific methods
interface ElectricVehicle extends Engine
void charge;
class ElectricCar extends Car implements ElectricVehicle
public ElectricCarString model
supermodel null; Engine can be null for electric cars
@Override
public void charge
Charging logic for electric cars
Which one of the following answers are incorrect Please check all that apply:
a
A composition relationship exists between Car and Vehicle
b
ElectricVehicle is a subclass of Engine
c
Engine is a subclass of Vehicle
d
Class Vehicle realizes the interface Engine
e
ElectricVehicle is realized by ElectricCar
f
Bike is a subclass of Engine
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
