What is the use of anonymous inner classes ?
Answer Posted / sumit bansal
Anonymous class exist till the method or block (In which it
is defined) runs. After that it vanishes so it help to use
the memory efficiently.
in your code if you want a particular class once and that
is also in the method/block use anonymous class.
it is the best of my knowledge. if you know more please
reply me.
| Is This Answer Correct ? | 20 Yes | 5 No |
Post New Answer View All Answers
Write a java program for binary search?
What is preflight request?
What is sizeof () operator?
Can we overload the constructors?
Is a copy constructor?
What are runtime exceptions?
how to create constants in java?
Why do we need variables?
What is Mutex (Mutual Exclusion Object) ?
Is stringwriter thread safe?
Which are the two subclasses under exception class?
Define reflection.
What are the rules for variable declaration?
What is a char in java?
What do you understand by copy constructor in java?