News

The finalize () method has been present since Java 1.0, and is widely regarded as a misfeature and a significant piece of legacy cruft in the platform. An object that overrides finalize () is ...
In that pattern, a destructor method (known as finalize () in Java) is provided, to enable automatic cleanup, and release of resources when the object is destroyed.
Because all exception classes ultimately derive from Throwable (in the java.lang package), Object declares finalize() with a throws Throwable clause appended to its method header.
However, you should end your finalize() methods with calls to super.finalize ();. During the class hierarchy design, you might insert a superclass — one that declares its own finalize() method ...