About Question com.enthuware.ets.scjp.v6.2.506 :

Help and support on OCA OCP Java Programmer Certification Questions
1Z0-808, 1Z0-809, 1Z0-815, 1Z0-816, 1Z0-817

Moderator: admin

Post Reply
sarmadys
Posts: 4
Joined: Thu Jul 10, 2014 12:03 am
Contact:

About Question com.enthuware.ets.scjp.v6.2.506 :

Post by sarmadys »

Even if we remove the unreachable return at the end of the function, in try and catch sections we have a "return". Why the function does not return even before running the finally?

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

Re: About Question com.enthuware.ets.scjp.v6.2.506 :

Post by admin »

I am not sure I understand your question. As the explanation says, if you remove the return at the end, options 1, 2, and 3, are correct. Finally is always run (except when you have System.exit()) because that is how the language is designed.

Veilok
Posts: 21
Joined: Sat Sep 01, 2018 10:53 am
Contact:

Re: About Question com.enthuware.ets.scjp.v6.2.506 :

Post by Veilok »

enthuware.ocpjp.v21.2.984
The code snippet in this question is not properly formatted — indentation is missing, which makes it difficult to read

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

Re: About Question com.enthuware.ets.scjp.v6.2.506 :

Post by admin »

Right. Fixed.
thank you for your feedback!

Post Reply

Who is online

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