When Does JVM Call the Finalize Method in Java ?

JVM instructs the Garbage Collector to call the finalize method, just before releasing an object from the memory. A programmer can implement finalize() method to explicitly release the resources held by the object. This will help in better memory management and avoid any memory leaks.



You May Interest

How Will You Implement ApplicationContext in Spring Framework ?

What is the Difference Between an ArrayList and a LinkedList Data ...

What is the Difference Between an Iterator and ListIterator in Ja ...

What are the Lifecycle Methods of a JSP ?

How Can You Make an Object Eligible for Garbage Collection in Jav ...