Hi, could anybody explain which two objects would be eligible for garbage collection after line marked 6 in the following code :-
class C { public static void main(String a[]) { C c1=new C(); C c2=m1(c1); C c3=new C(); c2=c3; //6 anothermethod(); } static C m1(C ob1){ ob1 =new C(); return ob1; } }
[ June 14, 2008: Message edited by: gylph knor ] [ June 14, 2008: Message edited by: gylph knor ]
actually this question was asked in a test and the answer given was 2. i also coudn't figure out the 2 objects, thats why i posted it here. [ June 15, 2008: Message edited by: gylph knor ]