10 date 2007.08.16.19.10.01; author vcss232; state Exp;
37 * A class to test the definition of ShapeException in CS 2 lab 3
40 * @@author Jim Vallino
44 public class TestException {
47 * The constructor - invokes a method where an exception occurs
52 public TestException() {
56 catch( ShapeException e ) {
57 System.out.println( "ShapeException caught" );
58 System.out.print( "The message text was: " );
59 System.out.println( e.getMessage() );
64 * Throw a ShapeException so that we can catch it
66 * @@exception ShapeException always thrown "exception thrown in methodA"
69 public void methodA() throws ShapeException {
70 throw new ShapeException( "exception thrown in methodA" );
74 * A driver program to test student's ShapeException class
76 * @@param args command line arguments (ignored)
79 public static void main( String[] args ) {
80 TestException test = new TestException();