class TestA {

TestB b;
TestA(){
b=new TestB(this);
}
}
class TestB{ TestA a;
TestB(TestA a){
this.a=a;
}
}
class TestAll{ public void static main(String[] args){

new TestAll().makeThings();
//...code continues on
}
void makeThings(){
TestA test=new TestA();
}
}
The object referenced by a is eligible for garbage collection
The object referenced by b is not eligible for garbage collection