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

http://www.jchq.net/certkey/0401certkey.htm
did not understand it clearly.


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

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

x
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.

CEHJCommented:
See http://java.sun.com/docs/books/jls/second_edition/html/classes.doc.html

"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.
CEHJCommented:
:)
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
Java

From novice to tech pro — start learning today.