inner classes question

For a class defined inside a method, what rule governs access to the variables of the enclosing method?

1 ) The class can access any variable
2) The class can only access static variables
3) The class can only access transient variables
4) The class can only access final variables

>>>>The class can only access final variables

Note that this restriction applies to variables in the enclosing method, not the enclosing class

I was reading above question from link
did not understand it clearly.

 Any ideas, resources,sample code,links,  highly appreciated. thanks in advance.
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.


"Any local variable, formal method parameter or exception handler parameter used but not declared in an inner class must be declared final, ..."

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
gudii9Author Commented:
>>exception handler parameter used but not declared in an inner class must be declared final

how to use exception handler paramete inside inner class. Can you please point me to some simple example.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.