What is the significance of finalize() method in Java?
Answered
What is the significance of finalize() method in Java? When finalize is used?
Best answer
In Java, finalize() method is called by the garbage collector before reclaiming the memory allocated to the object. A class overrides the finalize() method to dispose of system resources or to perform other cleanup. However the usage of finalize() method is not recommended because the execution of finalize() method is not guaranteed and there is a severe impact on performance.