diff --git a/src/main/java/org/example/util/VehicleInspector.java b/src/main/java/org/example/util/VehicleInspector.java new file mode 100644 index 0000000..4116550 --- /dev/null +++ b/src/main/java/org/example/util/VehicleInspector.java @@ -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" + } +}