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
About Question enthuware.ocajp.i.v8.2.866 :
Moderators: Site Manager, fjwalraven
-
- Posts: 12
- Joined: Wed Aug 08, 2018 2:56 am
- Contact:
-
- Site Admin
- Posts: 10078
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.ocajp.i.v8.2.866 :
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).
If you like our products and services, please help us by posting your review here.
-
- Site Admin
- Posts: 10078
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.ocajp.i.v8.2.866 :
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).
If you like our products and services, please help us by posting your review here.
-
- Posts: 1
- Joined: Sat Sep 22, 2018 7:11 am
- Contact:
Re: About Question enthuware.ocajp.i.v8.2.866 :
Please, recheck. Still seems like this question is invalid as it states "Select all correct options" and both answers ARE correct
-
- Site Admin
- Posts: 10078
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.ocajp.i.v8.2.866 :
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!
thank you for your feedback!
If you like our products and services, please help us by posting your review here.
Who is online
Users browsing this forum: No registered users and 10 guests