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

Moderator: admin

Post Reply
abutalib
Posts: 3
Joined: Wed Aug 08, 2018 2:56 am
Contact:

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

Post by abutalib » Wed Aug 08, 2018 3:01 am

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

admin
Site Admin
Posts: 7411
Joined: Fri Sep 10, 2010 9:26 pm
Contact:

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

Post by admin » Wed Aug 08, 2018 3:09 am

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.

admin
Site Admin
Posts: 7411
Joined: Fri Sep 10, 2010 9:26 pm
Contact:

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

Post by admin » Wed Aug 08, 2018 3:09 am

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.

ivanzi
Posts: 1
Joined: Sat Sep 22, 2018 7:11 am
Contact:

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

Post by ivanzi » Sat Sep 22, 2018 7:14 am

Please, recheck. Still seems like this question is invalid as it states "Select all correct options" and both answers ARE correct

admin
Site Admin
Posts: 7411
Joined: Fri Sep 10, 2010 9:26 pm
Contact:

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

Post by admin » Sat Sep 22, 2018 7:43 am

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!
If you like our products and services, please help us by posting your review here.

Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 5 guests