What is the purpose of Finalization in java?

Posted by Karthik on Stack Overflow See other posts from Stack Overflow or by Karthik
Published on 2010-03-15T21:19:27Z Indexed on 2010/03/15 21:29 UTC
Read the original article Hit count: 239

Different websites are giving different opinions.

My understanding is this:

To clean up or reclaim the memory that an object occupies, the Garbage collector comes into action. (automatically is invoked???)

The garbage collector then dereferences the object. Sometimes, there is no way for the garbage collector to access the object. Then finalize is invoked to do a final clean up processing after which the garbage collector can be invoked.

is this right?

© Stack Overflow or respective owner

Related posts about java

Related posts about interview-questions