Page 1 of 1

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

Posted: Sun Aug 10, 2014 4:32 am
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?

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

Posted: Sun Aug 10, 2014 9:12 am
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.

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

Posted: Mon Jun 09, 2025 3:47 pm
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

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

Posted: Tue Jun 10, 2025 12:08 am
by admin
Right. Fixed.
thank you for your feedback!