What is anonymous class?

Answer Posted / rimjhim

it is a local inner class without any name.
it is instantiated at the time of declaration and must be
extended by a class or implemented by an interface.

new [class name](argument list){anonymous class body};

overridden functions can be declared in this calss and it
can have only one new method inside it.more than one can
not be called anywhere.
using dot operator we can call that new function.

Is This Answer Correct ?    2 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is a parameter in a function?

704


How do you generate random numbers in java?

705


Explain notifyall() method of object class ?

831


What is use of static in java?

736


What is the static block?

765






List types of storage classes in java?

794


What is the memory leak in java?

704


Explain static nested classes ?

777


What is passing parameters in java?

698


Write an algorithm for quick sort?

781


Explain the scope or life time of class variables or static variables?

705


What do you mean by aggregation?

764


What exactly is a .class file?

766


What is a protected class in java?

717


what is interface in java? Explain

695