posted 18 years ago
Hi Barry Gaunt ,
Statement d=c=b=a implies that all are pointing to the same object i.e. to the Object refered by reference variable a.
i.e. d,c,b and a all will be referening same object. So as per my knowledge, objects created at 2,3,4 will be abondened and are eligible for GC. Finally at step 5, since d is assigned null so the object will become eligible for GC.
so overall 4 objects will become eligible for GC.
Please correct me if I am wrong.
Thanks,
Ritu