L8.2: Polymorphism - ModelX class
Thu Jun 01 2023 14:13:19 GMT+0000 (Coordinated Universal Time)
Saved by
@TestProSupport
public class ModelX extends Car {
boolean autoPilot = false;
public void switchAutopilotOn() {
autoPilot = true;
System.out.println("Autopilot is switched on");
}
public void switchAutopilotOff() {
autoPilot = false;
System.out.println("Autopilot is switched off");
}
public String returnCarModel() {
return "Car model is ModelX";
}
}
content_copyCOPY
Comments