Originally posted by rathi ji: Vivek , In second case also , object will be eligible for GC as soon as the method will get complete .
Yes that is true, but the real question is how soon the object will be EGC. Get it?
It is really frustrating how people misspell my name , it is not Vicky, Vivek, Velder, or any other awkward combination. It is simply pronounced V-I-C-K-E-N, think of it as a combination of Vicky and Ken (just drop the y). Thank you for your time and happy ranching.
My apologies rathi if i sounded harsh, nothing personal is intended. [ February 05, 2005: Message edited by: Vicken Karaoghlanian ]
- Do not try and bend the spoon. That's impossible. Instead, only try to realize the truth. - What truth? - That there is no spoon!!!
In first case also, object will be eligible for GC as soon as the method will get complete.
I don't think so.
In the first case, the myClass object will last at least as long as the Other object. In the second case, the myClass object will be eligible for collection as soon as method m() returns and the stack frame holding ob is discarded.