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 is the Reason For Overriding equals Method in Java ?

What are the Java Collection Classes That Implement List Interfac ...

What is the Difference Between a Set and a Map in Java ?

How Will You Use Other Java Files of Your Application in JSP Code ...

What is the Difference Between a Cookie and a Session Object in J ...