feat: implement VehicleInspector utility
This commit is contained in:
@@ -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"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user