Home > DeveloperSection > Interviews > What is finalize method ?

Posted on    July-15-2015 9:57 PM

 Java Java 
 1 Answer(s)
  513  View(s)
Rate this:

Mayank Tripathi
Mayank Tripathi

Total Post:807

Posted on    July-15-2015 9:57 PM

The Object class has a special method named finalize() that is called by garbage collector to allow an object to do the necessary cleanup that needs to occur before the memory used by the object are reclaimed. The finalize() method can be overridden by any class that uses system resources (file , db connection) and needs to release those resources or to perform other cleanup as part of implicit destruction by the garbage collector.

Don't want to miss updates? Please click the below button!

Follow MindStick