Advertisement
Sheero

NegativeUnitsException

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