What is anonymous class?
Answers were Sorted based on User's Feedback
Answer / niranjanravi
An Anonymous class is a class which is defined at run time
without having any name and it is instantiated and declared
at the same place.
Syntax:
new class classname(){}
new interface interfacename(){}
Keyword extends and implements are usedin this class.
It is always implicitly final.
It is never static or final.
Is This Answer Correct ? | 3 Yes | 0 No |
Answer / 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 |
Is a boolean variable?
What are different data structures in java?
What is nextint java?
Can a class be private in java?
What are decalarations?
How to make object serializable in java?
Explain inheritance in java?
What is design pattern and there types?
how to open and edit XML file in Weblogic???
Does apple use java?
Under what conditions is an object’s finalize() method invoked by the garbage collector?
Can we clone singleton class in java?