posted 17 years ago
The question doesnot make sense. "obj" is a "(local) reference variable". What is garbage-collected are not references, but the "objects". So your question should have really been "When is the object created on such-and-such line eligible for garbage collection"
Given that, since the reference returned by the program refers to the same object that you are talking about, the object doesnot become eligible for GC when the given piece of code is getting executed.