What is the purpose of finalization

The purpose of finalization is to give an unreachable object the opportunity to performany cleanup processing before the object is garbage collected.

Showing Answers 1 - 7 of 7 Answers

ramu

  • Mar 10th, 2006
 

Finalization can be used to run the finalizers (which have not been executed before) for the objects eligible for garbage collection

  Was this answer useful?  Yes

sagar.singh

  • Aug 23rd, 2007
 

Java provides a method called finalize( ) that you can define for your class. Here’s how it’s supposed to work. When the garbage collector is ready to release the storage used for your object, it will first call finalize( ), and only on the next garbage-collection pass will it reclaim the object’s memory. So if you choose to use finalize( ), it gives you the ability to perform some important cleanup at the time of garbage collection

lwpro2

  • Mar 13th, 2011
 

Actually in addtion to perform some clean up process, it can also be used to bring this object to life, by making it accessible again.

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions