Hello thanks for making the concept clear, but i have a small confusion with second question
according to Jas and Steven explanation this is how i understood
followin is the question
what two lines of code inserted independently at line 18, will make an object eligible for garbage collection?(select two.)
a) x3 = null;
b) x4 = null;
c) x5 = null;
d) x3 = x4;
e) x5 = x4
so
at line 17
Obj 1 has still x3 and x4 references on it
and Obj 2 has x5 referance
so i agree making x5= null would make Obj 2 referances free and is eligible for garbage colletion also redirecting x5 to Obj1 ie by refering to x4 Obj2 referance free
but in that case y not selecting (a)&(b) wouldnot be the correct answers
if x3= null and x4 = null Obj1 would be referance free and will be available for garbage collection.
If my way of understanding the concept is clear should (a) & (b) are they not right answers
This question is from K&B selftest only and i dont think they will give wrong answers
i am just confused for this pls explain
thanks
Deepika
[ May 25, 2005: Message edited by: Deepika Namasani ]