2 Commits
+12
View File
@@ -56,4 +56,16 @@ public class ElectricCar extends Car implements Chargeable {
chargeLevel += amount; chargeLevel += amount;
} }
} }
@Override
public void performService() {
super.performService();
System.out.println("Electric engine and oil checked");
this.chargeLevel = 100;
}
@Override
public boolean needsService(Vehicle v) {
return getMileage() > 10000;
}
} }