A d = new A().aob =new A();
This is the key line here. There is one object eligible for GC here. The object in bold is actually assigned to d and the object in italics is eligible for GC...
d points to the last object created with new A(), not the object created with new A().aob.
Object new A.aob is eligible to gc since there is no reference that points to it.
And the total number of objects eligible for gs is 2.
Look at this example.
Mark Moge
Ranch Hand
Joined: Mar 14, 2009
Posts: 88
posted
0
Thanks for clarifying. Now I can see how it works.
Prithvi Sehgal
Ranch Hand
Joined: Oct 13, 2009
Posts: 735
posted
0
I can smell in air, that why ExamLab is considered to be tough.
I must praise Devaka for putting such a great effort and making it open-source for the community.
My special thanks to Devaka.
Apologies Devaka wrong word i must say. Not open-source. To my knowledge, before somtime, ExamLab was free , i am not really sure if you have updated it at commercial level.
Let me know.