File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes finally clause question Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "finally clause question" Watch "finally clause question" New topic

finally clause question

Heena Velani

Joined: Sep 14, 2007
Posts: 5
In K&B, on page no.348 it is mentioned that,
"Later we'll look at the few scenarios in which finally might not run or complete".
But after reading the whole topic of exception I couldn't find any examples. Does anybody know about any scenarios where finally clause might not run or complete? Or if it is in the book can anybody please tell at which place they are mentioned.
abhishek pendkay
Ranch Hand

Joined: Jan 01, 2007
Posts: 184
a finally block will fail to run only in extreme cases such as
1) your JVM crashes
2) your system crashes
3) you get some sort of JVM error
you got what i want to say right so it takes a catastrophic situation for a finally block not to run and also this is mentioned in K&B i have read it just dont remember the page

The significant problems we face cannot be solved by the same level of thinking which created them – Einstein
SCJP 1.5, SCWCD, SCBCD in the making
Heena Velani

Joined: Sep 14, 2007
Posts: 5
Thanks Abhishek,
You are right, it's also given in the two minute drill on page no.387
I agree. Here's the link:
subject: finally clause question
It's not a secret anymore!