Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

finally clauses and different JVM's

 
Joseph Maddison
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 7729
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic