It's not a secret anymore!
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Finally abrupt return Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Reply locked New topic

Finally abrupt return

Vikrant Sahdev
Ranch Hand

Joined: May 31, 2007
Posts: 58
I found this question on a Mock exam for SCJP1.5:

I think the answer should be A1 but its A4. I think its A1 bcos even though return exits finally block abruptly,it still compiles without error.

What do you guys think ?
Also do you think there would be any difference in answer,if compiled with 1.4 or 1.5 ?

Coming soon...
Peter Mularien
Ranch Hand

Joined: Sep 06, 2007
Posts: 84
There's no compiler error when using the 1.4.2 or 1.6.0 compiler. I agree with you that it should print 3. Do they give any indication as to what the compiler error would be?

Author, Spring Security 3 (the Book), Packt Publishing, 2010
Burkhard Hassel
Ranch Hand

Joined: Aug 25, 2006
Posts: 1274
double thread closed.
answer here please:
I agree. Here's the link:
subject: Finally abrupt return
It's not a secret anymore!