November 9, 1998

Finalization and Cleanup

Although Java does not provide a destructor as in C++, you can use an overridden finalize() method for similar purposes. The overridden finalize() method is invoked on an object before the garbage collector reclaims the memory occupied by the object. If the method named runFinalizersOnExit(true) is invoked, an overridden finalize()