posted 22 years ago
Sharda, just see if the following can throw light on ur issue.
First time when the object is de-refernced, it is eligible to be garbage collection. At that time, finalize method is called just before garbage collection.
In this case the object is re-refernced and so it is not garbage collected and again available in the program.
Next time again when the object is de-referenced, it is eligible to be garbage collected. But since finalize method will not be called the second time, so no chance of re-referncing. Therefore it will be garbage collected.
Also to know more abt Garbage collection like " stop-and copy) u can refer "Thinking in Java" by Bruce Eckel, Ch-4.
Regards
Shweta
--Shweta<br />SCJP 1.4 <br />SCWCD