posted 23 years ago
Hi,
Please help me to understand what is wrong with answer �B�. given answer is �C�, �D�.
Given that method aMethod() throws BaseException, SubException and RuntimeException of the following exception hierarchy
Which of the following are legal
A.public class MyClass {
public void myMethod(){
aMethod();
}
}
B.public class MyClass{
public void myMethod() throws BaseException,RuntimeException{
aMethod();
}
}
C.public class MyClass{
public void myMethod() throws BaseException{
aMethod();
}
}
D.public class MyClass{
public void myMethod() throws Exception{
aMethod();
}
}
E.public class MyClass{
public void myMethod() throws RuntimeException {
aMethod();
}
}
regards
vivek
[This message has been edited by Vivek Shrivastava (edited August 04, 2000).]
[This message has been edited by Vivek Shrivastava (edited August 05, 2000).]
[This message has been edited by Vivek Shrivastava (edited August 05, 2000).]
[This message has been edited by Vivek Shrivastava (edited August 05, 2000).]