Question: In Java Parkable: This should be an interface with:a method called park() which: Returns a boolean to note if the Parkable object has been parked
In Java
Parkable:
This should be an interface with:a method called park() which:
Returns a boolean to note if the Parkable object has been parked correctly or not.
a method called unpark() which:
Returns a boolean to note if the Parkable object has been unparked correctly or not.
Auto:
Should implement the Parkable interface.
For park, only return true if the Auto has a permit.
For unpark, always return true (eventually we will add auto boots for cars that are illegally parked)
Bicycle:
Should implement the Parkable interface.
For park, set the Bicycle's attribute for locked to true, then return true;
For unpark, set the Bicycle's attribute for locked to false, then return true;
----------------------------------------------
Static stuff!
The ParkingSpace object will get a static variable for tracking number of parking spaces
Use this static variable to set the number of the parking space in both ParkingSpace constructors
Remove the number parameter from the the Full ParkingSpace Constructor
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
