First page Back Continue Last page Summary Text


In Java objects are in a very real sense immortal - they do not die, they are merely forgotten (and sometimes the memory they occupy will be reclaimed). This has a number of obvious advantages - in particular, one cannot have a reference to an object that no longer exists (this is a major element of the Java security model).
This means that we cannot destroy an object once it has been created, but if we eliminate all references to it it is "forgotten" and can therefore be ignored – it is not part of the system state. (Unless their finalize method changes the state of the system – which is not advisable since there is no guarantee that finalisers will ever execute.)