Complete Car project implementation.

This commit is contained in:
Fatemesadat Mirabootalebi
2026-05-02 12:03:14 -07:00
parent 6cb8f9a8d8
commit 6903f5c0ad
7 changed files with 156 additions and 17 deletions
@@ -18,5 +18,14 @@ public class VehicleInspector {
// 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");
}
}
}