LLD - Design — Parking Lot System
Given the following code snippet, what will be the output?
class Vehicle {
String licensePlate;
Vehicle(String plate) { licensePlate = plate; }
}
class Spot {
Vehicle parkedVehicle;
boolean isOccupied() { return parkedVehicle != null; }
}
Spot spot = new Spot();
System.out.println(spot.isOccupied());