This week we will be working with throwing our exceptions and using try and catch blocks.
-----------------------------------
Throwing the Exceptions:
LotFullException: Adjust both of ParkingLot's park() methods to throw this exception instead of returning false if the ParkingLot is full and your Auto/Bicycle cannot be parked.
VehicleMissingException: Adjust ParkingLot's find() method to throw this exception instead of return null if the target vehicle is unable to be found inside the ParkingLot
1
Expert's answer
2018-04-13T09:01:14-0400
public class VehicleMissingException extends Exception{ public VehicleMissingException(){} public VehicleMissingException(String message){ super(message); } }
public class LotFullException extends Exception{ LotFullExeption(){} LotFullException(String message){ super(message); } }
Comments
Leave a comment