FootNote

When a user defines the void finalize() method in a class definition, finalization is enabled for objects of that class. Finalization of an object consists of the system calling the object's finalize() method. Finalization normally occurs asynchronously at some time after the garbage collection mechanism identifies an object as inaccessible. Users can invoke their finalize() method explicitly but this doesn't guarantee that the system will not call it again at a later time. If a finalized object references another finalized object, the objects are finalized in the reverse order of their creation. Java does not guarantee when or if a given finalized object will have its finalize() method called. Thus, finalization should not be relied on for program correctness. Rather, finalization should be thought of as an optimization.