Hi!
Question from SCJP test:
class A{
A aob;
public static void main(String args[]){
A a=new A();
A b=new A();
A c=new A();
a.aob=b;
b.aob=a;
c.aob=a.aob;
A d=new A().aob=new A();
c=b;
c.aob=null;
System.gc();
}
}
Question: after c.aob=null
is executed, how many objects are eligible for garbage collection.
I think that 1, but correct answer 2. What's wrong?