when will garbage wiil be collected
posted 11 years ago
I don't think there is any definitive answer to this because it depends on the garbage collector implementation. My knowledge is limited, but I believe in most modern implementations an object will be eligible for collection when it can no longer be reached from a 'root'. The non-static and static methods have nothing to do with each other in terms of collection. A static member has no effect on when a particular instance of that class may be collected.