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

Answers were Sorted based on User's Feedback



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

Answer / janet

yes, we can have an inner class inside a method and final
variables can be accessed.

Is This Answer Correct ?    15 Yes 0 No

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

Answer / 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

More Core Java Interview Questions

A non-static inner class may have object instances that are associated with instances of the class’s outer class. A static inner class does not have any object instances.

0 Answers  


Can we override private method in java?

0 Answers  


Can this keyword be used to refer static members?

0 Answers  


I have multiple constructors defined in a class. Is it possible to call a constructor from another constructor’s body?

0 Answers  


List some oops concepts in java?

0 Answers  


Describe the various concepts related to object oriented programming (oop).

0 Answers  


How can you share data between two thread in Java?

0 Answers  


What is java full form?

0 Answers  


what is comparable and comparator interface?

0 Answers  


How do you call a reference in java?

0 Answers  


What is literal example?

0 Answers  


Explain break statement and continue statement?

3 Answers  


Categories