This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Local class

 
Valentin Jacquemin
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello everybody,

I'm a little bit confuse this morning (yes it's the morning in switzerland ;-)). Well i'm confuse because I'm learning stuff about local class and ok, we must mark a variable as final in the method if we want to access it in the local class. But then if we create a local class that access it and then reference it and finally we send this new object to an another location, the member variable won't be garbage collected?

So in this case, the scope of this local variable is extended, is it true what I said?

Thanks
 
Gowher Naik
Ranch Hand
Posts: 643
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
it would be better if you will write some code then we
will discuss here.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic