115
Java Object finalize() Method
Finalize() is the method of Object class. This method is called just before an object is garbage collected. finalize() method overrides to dispose system resources, perform clean-up activities and minimize memory leaks.
Syntax
Throw
Throwable – the Exception is raised by this method
Example 1
Output:
2018699554 end of garbage collection finalize method called
Next TopicJava Object Class