finalize() is one of the 9 methods in java.lang.Object class. The api docs for the function state:
Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.
- But what does the finalize() method actually do?
- What happens if we manually call the finalize() method?