Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Zehra Baig
- //CSC-162-01
- //Lab 6-C
- public class NegativePriceException extends Exception
- {
- //Default Constructor
- public NegativePriceException()
- {
- super("Price cannot be negative");
- }
- //Overloaded Constructor
- public NegativePriceException(double d)
- {
- super("Negative price " + d + " is invalid");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement