Advertisement
Guest User

LessThanOrGreaterThanException.java

a guest
Feb 26th, 2022
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.43 KB | None | 0 0
  1. public class LessThanOrGreaterThanException extends RuntimeException {
  2.    
  3.     public LessThanOrGreaterThanException() {
  4.         super("\n**** Your number is either less than the min or greater than the max.");
  5.     }
  6.    
  7.     public LessThanOrGreaterThanException(String myField, int myNumber, int minNumber, int maxNumber) {
  8.         super("\n*****" + myField + ": " + myNumber + " is less than " + minNumber + ", or greater than " + maxNumber);
  9.     }
  10.  
  11. }
  12.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement