jQuery in Action, 3rd edition
The moose likes Java in General and the fly likes Inner Class Final vaiable reference Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Introducing JavaFX 8 Programming this week in the JavaFX forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Inner Class Final vaiable reference" Watch "Inner Class Final vaiable reference" New topic
Author

Inner Class Final vaiable reference

Raveendran Hs
Greenhorn

Joined: Feb 05, 2010
Posts: 23




for the above code i am getting below saying

Cannot refer to a non-final variable x inside an inner class defined in a different method


Q: why inner class method is not able to refer non final variable
Stephan van Hulst
Bartender

Joined: Sep 20, 2010
Posts: 4087
    
  18

Take a look here:
http://www.coderanch.com/t/524522/java-programmer-SCJP/certification/Special-treatment-final-vaiables-method


The mind is a strange and wonderful thing. I'm not sure that it will ever be able to figure itself out, everything else, maybe. From the atom to the universe, everything, except itself.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Inner Class Final vaiable reference
 
It's not a secret anymore!