67 154
Assignments Done
99,4%
Successfully Done
In November 2018

Answer to Question #75989 in Java | JSP | JSF for Maayuk

Question #75989
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
Expert's answer
public class VehicleMissingException extends Exception{
public VehicleMissingException(){}
public VehicleMissingException(String message){
super(message);
}
}

public class LotFullException extends Exception{
LotFullExeption(){}
LotFullException(String message){
super(message);
}
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be first!

Leave a comment

Ask Your question

Submit
Privacy policy Terms and Conditions