Site hosted by Angelfire.com: Build your free website today!
 

Creating Your Exception Classes

package simplestack;

public class StackOverflowException extends Exception {
   public StackOverflowException() {
       super("StackOverflow Exception");
   }
   public StackOverflowException(String message) {
       super(message);
   }
   public StackOverflowException(String message, Throwable cause) {
       super(message, cause);
   }
   public StackOverflowException(Throwable cause) {
       super(cause);
   }
}
package simplestack;
public class StackUnderflowException extends Exception {
   public StackUnderflowException() {
       super("Stack Underflow Exception");
   }
   public StackUnderflowException(String message) {
       super(message);
   }
}