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
What are the different collection views provided by maps?
Variables used in a switch statement can be used with which datatypes?
Can long be null in java?
What is arrays aslist in java?
What is meant by interface?
Can constructor be synchronized?
What does java final mean?
Is heap stored in ram?
What is a boolean field?
Difference between character constant and string constant in java ?
What is immutability in java?
What are wrapped classes in java programming?
what is meant by encapsulation?
How to find the index of the largest number in an arraylist java?
Explain method local inner classes ?