COSC 2011N
Practice Questions: Exceptions
Solutions

1.  Correct answer: (a).  Since calcStuff() does throw an exception, any method calling calcStuff() must either catch the exception by enclosing the call to calcStuff() inside a try/catch/finally block or the calling method must declare in its signature that it throws a TypaA1Exception.

2.  Correct answer: (b), (c) and (d).

3.  Correct answer: (a).  Remember, an exception object is like any other object in Java - it must be instantiated in order to be used.  Therefore, before being thrown, the exception object is instantiated using the new keyword.