How Can We Reference an Unreferenced Object Again in Java ?

We can provide implementation in finalize() method to reference and unreferenced object. For an unreferenced object, finalize() method is called at the time of Garbage Collection. At this time, Object can pass its reference ‘this’ to finalize() method and revive itself.



You May Interest

Does Java Allow Virtual Functions ?

What is the Lifecycle Stages of JSP ?

How Will You Delete a Cookie in JSP ?

What is the Difference Between Sleep and Wait Methods in Java ?

What is the Difference Between wait and sleep Methods in Java ?