What is the use of anonymous inner classes ?

Answer Posted / bindhu

We can declare an inner class within the body of a method
without naming it. These classes are known as anonymous
inner classes
Very useful for controlled access to the innards
of another class. and useful when we need one instance of a
special class.

Is This Answer Correct ?    11 Yes 6 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is your platform?s default character encoding and how to know this?

1726


Difference between default and protected access specifiers?

479


What is size () in java?

515


What are basic keywords?

533


What are the features of junit?

574






Give few difference between constructor and method?

497


What is the difference between an object-oriented programming language and object-based programming language?

542


What is boolean flag in java?

541


What data type is a string?

482


What is downcasting?

551


What is the difference between interface & abstract class?

539


When object is created and destroyed?

618


What are the 3 types of loops in java?

506


Can we have multiple catch block for a try block?

567


What are streams?

610