/* TestException5.java CIS 160 David Klick 2005-06-01 This program will compile. When the exception is generated, it will be caught and a message displayed (the stack trace). The customized exception includes the ability to store a message. */ public class TestException5 { public static void main(String[] args) { try { causeException1(); } catch (MyException e) { System.out.println("Error: " + e.getClass().getName() + " thrown"); e.printStackTrace(); } } static void causeException1() throws MyException { throw new MyException("A special message"); } } class MyException extends Exception { MyException() {} MyException(String s) { super(s); } }