Explain restrictions for using anonymous inner classes?



Explain restrictions for using anonymous inner classes?..

Answer / Mukesh Kumar Singh

Anonymous inner classes can only be declared within a static-free context, such as an instance method or a top level class. They cannot have constructors, cannot extend multiple classes, and cannot implement more than one interface.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Core Java Interview Questions

Write a java program that prints all the values given at command-line.

1 Answers  


What is the difference between arraylist and hashset in java?

1 Answers  


How is hashset defined in java?

1 Answers  


Is 0 true or false in java?

1 Answers  


what really hapens when a object is created using new operator? 1.is it allocates memory to all variables and methods in the class with reference to that object?

3 Answers  


What is square root in java?

1 Answers  


How u dubugg ur project?

1 Answers   iFlex,


What is yielding and sleeping? how they different?

2 Answers  


when asub class inherits a super class and overrides a public method of super class in sub class(public method in super class). why these methods needs to be public in sub class. (otherwise compile time error).

3 Answers  


What is an iterator java?

1 Answers  


How concurrent hashmap works?

1 Answers  


What are 5 boolean operators?

1 Answers  


Categories