General guide lines:
G.C. cannot be forced only requested.
The G.C. doens�t prevent an OutOfMemoryError
.
The g.c. of an object is not guaranted.
The finalize method of an object will be only called (automatically) if the g.c. is running. It is not guaranted its execution though. However it is guaranted that if executed, it will be executed only once for an object, just before its memory is reclaimed. Also it is guaranted that if an object is recycled its finalized method has already been executed.
An object is eligable for g.c. if it is unreachable by all the reachable objects. This means that A is eligable for g.c. if there aren't any references to it, except from, for instance, from B object which is also unreachable.
Be careful with aliasing the objects. If two or more variables points to the same object, typical mock exams try to confuse by only seeting to null, or copying new values to them, to only some of the variables.
Just keep posting the Ranch the questions you find difficult in the mocks
[ March 17, 2002: Message edited by: Jose Botella ]
[ March 17, 2002: Message edited by: Jose Botella ]