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 is encapsulation in java? Explain

661


What is arraylist class in java?

507


How do generics work in java?

518


What is OOP's Terms with explanation?

600


What are white spaces in java?

525






What is integer size in java?

505


Will minecraft java be discontinued?

644


What is a method vs function?

550


What is instance synchronization?

541


Does java trim remove newline?

538


What is java and why do we need it? Explain

581


What is meant by null and void?

532


What package is math in java?

530


What is module with example?

510


what is the difference between preemptive scheduling and time slicing? : Java thread

527