Adding bonus parts.

This commit is contained in:
2026-07-17 23:03:43 +03:30
parent 81b635df0c
commit b39befac19
2 changed files with 83 additions and 0 deletions
+12
View File
@@ -56,4 +56,16 @@ public class ElectricCar extends Car implements Chargeable {
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;
}
}