feat: implement VehicleInspector utility

This commit is contained in:
2026-04-24 22:03:45 +03:30
parent 4fb333df45
commit 1bfe9ae2fe
@@ -0,0 +1,21 @@
package org.example.util;
import org.example.model.*;
/*
* Utility class to inspect vehicles.
* Demonstrates instanceof and polymorphism.
*/
public class VehicleInspector {
public static void inspect(Vehicle v) {
v.basicInfo();
// TODO:
// If ElectricCar → print "Check battery system"
// If SportsCar → print "Check brakes and performance"
// If GasCar → print "Check engine and oil"
}
}