Answer Posted / preetesh
An Anonymous class is an inner class that is not assigned a
name. It is defined and instantiated within arguments of a
method of the Outer Class.
Syntax is as follows:
----------------------
public class OuterClass
{
//some relevant code
methodName(new ClassName(){ }); /*It indicates compiler
that the code between the braces in the argument of the
method defines an anonymours inner class.*/
}
| Is This Answer Correct ? | 0 Yes | 1 No |
Post New Answer View All Answers
How to display all the prime numbers between 1 and n (n is the number, get the input from user)
What is difference between overloading and overriding in java?
What is the protected method modifier?
What are the steps in the jdbc connection?
Write a code to show a static variable?
what is static import in java? Explain
What are dot operator queries?
Can inner class have constructor?
How do you check if a string contains only numeric digits?
How many ways can you break a singleton class in java?
What is data and its types?
What is serialization in java?
What do you mean by flow of struts?
What is a jit compiler?
Difference between class#getinstance() and new operator ?