Can you have an inner class inside a method and what
variables can you access?

Answer Posted / kabita

yes we have.it is called local inner class.it can access
only final variables of outer class.

Is This Answer Correct ?    7 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Why to use nested classes in java?

811


describe synchronization in respect to multithreading? : Java thread

723


What is the difference between final, finally and finalize() in java?

814


What is the synonym of procedure?

768


Is java map thread safe?

723


Explain the use of volatile field modifier?

861


Is {a, n, d} a palindrome? If you are given a random string, is it a palindrome or not?

825


What is a byte string?

832


Does .length start 0 java?

773


What are java packages?

821


How do you override a method in java?

767


how we can make a write-only class in java?

797


Can private members of a base class are inheritable justify?

703


What is the syntax and characteristics of a lambda expression? Explain

823


Can we declare an array without size in java?

734