Advertisement
Sheero

NegativePriceException

Apr 26th, 2018
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.33 KB | None | 0 0
  1. //Zehra Baig
  2. //CSC-162-01
  3. //Lab 6-C
  4.  
  5. public class NegativePriceException extends Exception
  6. {
  7.     //Default Constructor
  8.     public NegativePriceException()
  9.     {
  10.         super("Price cannot be negative");
  11.     }
  12.  
  13.     //Overloaded Constructor
  14.     public NegativePriceException(double d)
  15.     {
  16.         super("Negative price " + d + " is invalid");
  17.     }
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement