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

What are the Main Uses of Spring MVC Module ?

What is the Purpose of Thread Groups in Java ?

What are the Uses of AOP Module in Spring Framework ?

What is Information Hiding in Java ?

What are the Lifecycle Methods of a JSP ?