Bookmark Topic Watch Topic
  • New Topic

Local variable lifetime  RSS feed

 
Matthew Jones
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
  • Report post to moderator
I asked this in the beginner forum, but no one seems to know there.
If I created a few local variables in a constructor, when are the variables eligible for garbage collection?
When the constructor finishes?(This is what I thought...)
When the object is destroyed?
Or do you have to explicitly set them to null so they can be collected?
Thanks!
 
Ajith Kallambella
Sheriff
Posts: 5782
  • Mark post as helpful
  • send pies
  • Report post to moderator
I still think the beginners forum is the right place to ask this question. Pl look there for my answer
I am going to close this thread here since it is kind of off topic for the Performance forum

------------------
Ajith Kallambella M.
Sun Certified Programmer for the Java2 Platform.
 
    Bookmark Topic Watch Topic
  • New Topic
Boost this thread!