File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Local class Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Local class" Watch "Local class" New topic

Local class

Valentin Jacquemin
Ranch Hand

Joined: Feb 15, 2006
Posts: 35
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?

Gowher Naik
Ranch Hand

Joined: Feb 07, 2005
Posts: 643
it would be better if you will write some code then we
will discuss here.
I agree. Here's the link:
subject: Local class
It's not a secret anymore!