Source of UnknownOpException.java


  1: /**
  2:  * A class representing the exceptional circumstance of an unknown operator 
  3:  * being entered into our Calculator program.
  4:  */
  5: public class UnknownOpException extends RuntimeException {

  7:     public UnknownOpException() {
  8:     }

 10:     public UnknownOpException(String message) {
 11:         super(message);
 12:     }

 14:     /**
 15:      * Extra constructor to allow exception to be created using just the 
 16:      * operator.
 17:      *
 18:      * @param op the unknown operator
 19:      */
 20:     public UnknownOpException(char op) {
 21:         super(Character.toString(op));
 22:     }
 23: }