This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
I could not understand some parts(i.e Bold Text) of the A Programmer's Guide to JavaSCJP Certification(By Khalid A. Mughal Rolf W. Rasmussen) of Object Finalization it says,
A finalizer can, like any other method, catch and throw exceptions (see Section
6.7, p. 245). However, any exception thrown but not caught by a finalizer that is
called by the garbage collector is ignored, and the finalization of this object is terminated.
The finalizer is only called once on an object, regardless of whether any
exception is thrown during its execution. In case of finalization failure, the object
still remains eligible for disposal at the discretion of the garbage collector (unless
it has been resurrected, as explained in the next subsection). Since there is no
guarantee that the garbage collector will ever run, there is also no guarantee that
the finalizer will ever be called.
If the program exits before garbage collector gets a chance to run, so there's no assurance that the finalize method will be called. If an object is eligible for GC, but the program exits before garbage collector runs, then the finalize method won't be called on that object...