This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes finally clauses and different JVM's Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "finally clauses and different JVM Watch "finally clauses and different JVM New topic
Author

finally clauses and different JVM's

Joseph Maddison
Ranch Hand

Joined: Nov 04, 2004
Posts: 53
From the following link, link it is clear that what is allowed in a finally clause depends on whether or not the JDK is 1.4.2 or later.

Prior to 1.4.2, finally clauses could have a return statement in them. Now, they give a compile error: warning: finally clause cannot complete normally.

The answer seems to be that a finally clause can not return a value, unless java.lang.Throwable is caught. My question is, is this particular nugget of information something on the SCJP Exam?

It would be important to know, especialy since it does not appear to be mentioned anywhere in the study guides I've looked at, including the Osbourne Java 2 Study Guide related to this web site.

Thanks,
jdmaddison

(fixed link, I hope)
[ November 04, 2004: Message edited by: Barry Gaunt ]
Barry Gaunt
Ranch Hand

Joined: Aug 03, 2002
Posts: 7729
I don't think you will see such a question on the current SCJP. But if you did, then I suggest you go with the pre-1.4.2 choice of answer.


Ask a Meaningful Question and HowToAskQuestionsOnJavaRanch
Getting someone to think and try something out is much more useful than just telling them the answer.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: finally clauses and different JVM's