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


Please Help Members By Posting Answers For Below Questions

What are the principle concepts of oops?

546


Explain about the select method with an example?

597


Can we overload the methods by making them static?

514


What do you mean by append?

546


What do you mean by default constructor in java?

590






What is a null class?

586


What is a java string?

551


What is the difference between Array and Hash Table?

553


How do you declare an array that will hold more than 64KB of data?

657


What is the disadvantage of java?

516


Tell me the latest versions in java related areas?

591


What are the features of junit?

617


List down the methods and interfaces of collection class in java.

562


How do you read a char in java?

475


What differences exist between iterator and listiterator?

585