When you say a method is finished, it does not mean the last line of the method. It means when control returns from that method. A method might have a return statement in some condition even before the last line. In this case once the return is executed, the method is finished. And all the objects created in the method upto that point would be eligible for GC.
Originally posted by Pavan Sambare: ...all the objects created in the method upto that point would be eligible for GC.
...assuming that these instances are referenced only through local variables -- as in the above example. But also remember that objects can outlive the methods in which they're created. [ October 16, 2006: Message edited by: marc weber ]
"We're kind of on the level of crossword puzzle writers... And no one ever goes to them and gives them an award." ~Joe Strummer sscce.org