Saturday, 25 May 2013

Exception - 22 -

Imagine there are two exception classes called Exception1 and Exception2 that descend from the Exception class. Given these two class definitions: 


package net.dharmaraj;

class First
{
    void test() throws Exception1, Exception2 { . . . }
}

class Second extends First
{
    void test() { . . . }
}

Create a class called Third that extends Second and defines a test() 
method. What exceptions can Third's test() method throw? 
Select all valid answers. 
a) Exception1 
b) Exception2 
c) no checked exceptions 
d) any exceptions declared in the throws clause of the Third's test() method. 

No comments:

Post a Comment