1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
package test; import java.io.PrintStream; import java.io.PrintWriter; public class TestException extends Exception { TestException (String m){ super(m); } public void printStackTrace(){ System.err.println(this.getMessage()); } public void printStackTrace(PrintStream s){ this.printStackTrace(); } public void printStackTrace(PrintWriter s){ this.printStackTrace(); } }