complete VehicleInspector class

This commit is contained in:
2026-04-27 19:14:41 +03:30
parent c4b7b55570
commit f406c54401
2 changed files with 15 additions and 7 deletions
-3
View File
@@ -24,9 +24,6 @@ public class SportsCar extends GasCar {
this.zeroToHundred = zeroToHundred;
}
// TODO: Override showDetails()
// Call super.showDetails()
// Print acceleration time
@Override
public void showDetails()
{
+15 -4
View File
@@ -1,6 +1,9 @@
package org.util;
import org.*;
import org.model.ElectricCar;
import org.model.GasCar;
import org.model.SportsCar;
import org.model.Vehicle;
/*
@@ -14,9 +17,17 @@ public class VehicleInspector {
v.basicInfo();
// TODO:
// If ElectricCar → print "Check battery system"
// If SportsCar → print "Check brakes and performance"
// If GasCar → print "Check engine and oil"
if (v instanceof ElectricCar)
{
System.out.println("Check battery system");
}
else if (v instanceof SportsCar)
{
System.out.println("Check brakes and performance");
}
else if (v instanceof GasCar)
{
System.out.println("Check engine and oil");
}
}
}