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

How do you find the maximum number from an array without comparing and sorting?

0 Answers   BlackRock,


Difference between string, string builder, and string buffer?

0 Answers  


class A{ m2(){ } } class B extends A{ m2(){ } } class c extends B{ m2(){ } } class my_class extends c{ m2(){ } pulic static void main(){ ...My_class a = new my_class(); super.super.super.m2(); is this is leagal if not find what is the legal procedure in order to call A's version of m2(); }

8 Answers   Logica CMG,


Can each java object keep track of all the threads that want to exclusively access it?

0 Answers  


What is the purpose of static keyword in java?

0 Answers  






Does set allows null in java?

0 Answers  


perpare on factorypattern,linklist wothout using collection, (multitharding ie create producer/customer therad producer create Queue continuesly,consumer consume queue, consumer wait if queue is full,producer wait if queue is empty),diff betn sleep(1000)&wait(1000) these r the main Q ask in huawei(2008)

1 Answers   Huawei,


can we overload main method?

8 Answers   TCS,


What is the difference between jfc & wfc?

0 Answers  


What is gc()?

0 Answers  


Thanks A.jyotsna, Can u tell me differnce between abstract class and interface vikash

4 Answers  


In which JDK version event-delegation model is introduced?

1 Answers  


Categories