complete code

This commit is contained in:
2026-04-28 00:53:37 +03:30
parent 6cb8f9a8d8
commit c65d263b45
7 changed files with 167 additions and 141 deletions
+12 -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,14 @@ 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");
}
}
}