What is the significance of finalize() method in Java?

Answered

What is the significance of finalize() method in Java? When finalize is used?

Ninja Asked on 17th September 2018 in Java.
Add Comment
1 Answer(s)
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.

Ninja Answered on 17th September 2018.
Add Comment