About Question enthuware.ocpjp.v8.2.1613 :
Posted: Mon Aug 15, 2016 8:59 pm
The question asks....
Which of the following exceptions can be declared in the throws clause of a method overriding the method:
public void perform_work( ) throws IOException {
//some code
}
one of the correct answers is an NPE.
I don't understand why this is correct. Is it because it is an unchecked exception?
I thought that if an exception of an overriding method was defined it would have to be of "Any Subclass of IOException"
Which of the following exceptions can be declared in the throws clause of a method overriding the method:
public void perform_work( ) throws IOException {
//some code
}
one of the correct answers is an NPE.
I don't understand why this is correct. Is it because it is an unchecked exception?
I thought that if an exception of an overriding method was defined it would have to be of "Any Subclass of IOException"