Suma Rangaraj wrote:
Say you create an object locally in a method but you only hold a reference to one of it's member variable's even after you are out of the method,
will the local object be GC'd ?
Based on your example, yes, the A object will be eligible for GC once the method goes out of scope. The
string array object, that was originally referenced by the A object, is still reachable, and will not be eligible for GC though.
Henry