Page 1 of 1

About Question enthuware.ocajp.i.v8.2.866 :

Posted: Wed Aug 08, 2018 3:01 am
by abutalib
The question is: What can be the type of a catch argument ?

I answered:

- Any class that extends java.lang.Exception (Wronged)
- Any class that is-a Throwable (Corrected)

How is it that the catch argument type cannot be java.lang.Excetpion?

Is it not the same as: catch(Exception e){}?

Thanks

Re: About Question enthuware.ocajp.i.v8.2.866 :

Posted: Wed Aug 08, 2018 3:09 am
by admin
catch(Exception e) is certainly correct but you need to select one option and catch(Throwable e) is what should be selected as the correct option because remember that Exception extends Throwable and therefore, catch(Throwable t) includes catch(Exception e).

Re: About Question enthuware.ocajp.i.v8.2.866 :

Posted: Wed Aug 08, 2018 3:09 am
by admin
catch(Exception e) is certainly correct but you need to select one option and catch(Throwable e) is what should be selected as the correct option because remember that Exception extends Throwable and therefore, catch(Throwable t) includes catch(Exception e).

Re: About Question enthuware.ocajp.i.v8.2.866 :

Posted: Sat Sep 22, 2018 7:14 am
by ivanzi
Please, recheck. Still seems like this question is invalid as it states "Select all correct options" and both answers ARE correct

Re: About Question enthuware.ocajp.i.v8.2.866 :

Posted: Sat Sep 22, 2018 7:43 am
by admin
You seem to be running a custom test with "Show number of correct options" disabled. I have updated the question to make it clear the best option has to be selected.

thank you for your feedback!