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 |
how to handle http request in struts
What is a variable simple definition?
What is the significance of java packages?
How can you make a class serializable in java?
How to print nodes of a Binary tree?
How many types of memory areas are allocated by JVM in java?
How java uses the string and stringbuffer classes?
What does math floor () do?
What is skeleton and stub?
what is the use of StringBuffer?
What does the “final” keyword mean in front of a variable? A method? A class?
Is there any tag in htm to upload and download files?