Implementing parking lot system in Java, using object-oriented principles.
- Compact spots and regular spots are subsections of car spots.
- A van can park in a single van spot or 3 regular spots.
- Parking spots for motorcycles, cars, and vans.
- Different types of parking spots for compact cars, regular cars, and vans.
- Methods to check remaining spots, total spots, and occupancy status.
- Support for parking and checking the occupancy of specific vehicle types.
ParkingSpot.java
: Represents a parking spot.ParkingLot.java
: Manages the parking lot and parking spots.VehicleType.java
: Enum representing types of vehicles.
To run the provided example:
-
Compile the Java files:
cd parkinglot javac *.java
-
Run the main class:
java Main