Jeff Sturm
Mon Mar 27 08:52:00 GMT 2000

Cedric Berger wrote:
> Finalization must only be used for releasing resources like memory,
> syncronization objects, ... which  means that its main use is for
> native methods.

No.  It is better to release all resources explicitly.  The class (for example) does have a close() method.  Your
code should always try to invoke close() before releasing the object. 
Finalization will probably eventually close it anyway, but it is poor
coding practice to rely on finalization that way.

Jeff Sturm

More information about the Java mailing list