posted 22 years ago
A finalizer is a method from class Object that any class may OVERRIDE. To OVERLOAD method "finalize()" would be futile since when it is used it MUST have the following signature:
protected void finalize() throws Throwable {
//do finalization stuff
}
Remember that although the "finalize()" override MAY be called on dead instances of the associated class before the memory occupied by that object is reused, to guarantee that it will be called is to use the method "System.runFinalizersOnExit(}" in the class as well.