jQuery in Action, 3rd edition
The moose likes Mock Exam Errata and the fly likes finalize Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Certification » Mock Exam Errata
Bookmark "finalize" Watch "finalize" New topic


hari kumar

Joined: May 14, 2001
Posts: 1
1.if I catch an exception in the finalize method, then the object will be garbage collected?
2.if I don't catch the exception thrown in finalize() then the object is not garbage collected, but remains elligible for garbage collection?
Are these stmts T?
Pls explain
Umesh Joglekar

Joined: May 02, 2001
Posts: 16
Here is a quote from M & R
"A finalizer can catch and throw exceptions like other methods. However, any exception thrown but not caught by the finalizer when invoked by the garbage collector is ignored. The finalizer is only called once on an object, regrdless of being interrupted by any exception during its execution, In case of finalization failure the object still remains eligible to be disposed of at the discretion of the garbage collector(unless it has been resurrected)
I agree. Here's the link: http://aspose.com/file-tools
subject: finalize
It's not a secret anymore!