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 Include a Static File in a JSP Page ?

What is the Purpose of Spring Configuration File ?

What is the Use of Interceptor Design Pattern in Java ?

What are the Main Benefits of Collections Framework in Java ?

How Can Be Read Data From a Form in a JSP ?