File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Mock Exam Errata and the fly likes Ambiguous Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Certification » Mock Exam Errata
Bookmark "Ambiguous "finally" question" Watch "Ambiguous "finally" question" New topic
Author

Ambiguous "finally" question

Rick O'Shay
Ranch Hand

Joined: Sep 19, 2004
Posts: 531
Q. If an exception is not caught finally is run and the rest of the method is skipped.

There are two interpretations of "not caught" so I would rephrase this as "If an exception is thrown and not caught" just to be clear. The other interpretation of "not caught" is not supplying a catch clause.
Jim Yingst
Wanderer
Sheriff

Joined: Jan 30, 2000
Posts: 18671
Agreed.

Was this from a particular mock exam somewhere?


"I'm not back." - Bill Harding, Twister
Stuart Gray
Ranch Hand

Joined: Apr 21, 2005
Posts: 410
Isn't finally always run, even if an exception is not thrown? This makes the question even less clear IMHO.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Ambiguous "finally" question
 
Similar Threads
Exceptions.Any help.
NullPointerException problem
doubts on try and finally block
Exceptions