posted 14 years ago
No, C2 will not be eligible for GC.
When you write -
C1.go(C2) --> you actually pass the reference of C2 object to other object, not the object itself.
so when you called this method -
C2 ==> refer to obj2
cb ==> refer to obj2
then you change cb referece -
cb = null
but C2 is still referring to obj2.