Friday, December 13, 2002 07:45 PM
Any reachable reference to the object will keep it from being garbage collected. If there is no other good place to keep it, you can probably just make it reachable from a static member.
Which begs another question... under what conditions can a class be garbage collected?
Anyway Trupti, why are you worrying about this? If an object is unreachable yet you want to make sure it doesn't get collected, you probably need to refactor your design. If you're just asking if reachable objects will ever be gc'd, the answer is no.