Error on OCP 1Z0-815 BOOK Deshmukh, Hanumant Page 389
Posted: Fri Mar 06, 2020 1:42 pm
In version october of 2019 page 389 in 15.3.3 just before to catch or to throw states that this code works?
English is not my nature language but for me i understand that the book states that this code works but it's not i have tested it on netbeans.
But reverse it works i mean throws Throwable in parent and Exception in the child method.
Perhaps i get it wrong
English is not my nature language but for me i understand that the book states that this code works but it's not i have tested it on netbeans.
Code: Select all
class Parent{
public static void foo()throws Exception{
}
}
public class EnthuwareStaticInheritedPlusExceptions extends Parent {
public static void foo()throws Throwable{
}
public static void main(String[] args) {
}
}
This not works just because is throwing a Throwable and the parent or original method is throwing a exception.public static void foo()throws Throwable{
}
But reverse it works i mean throws Throwable in parent and Exception in the child method.

Perhaps i get it wrong
