Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

What is the use of anonymous inner classes ?

Answer Posted / suneetha

The use of anonymous inner classes is to access the data of
outer class.Even private data also we can access.

button.addActionListerner(new ActionListener(){
public void actionPerformed(){}
});

here we are using anonymous class to implement
ActionListener interface.If at all we are using other class
that implements ActionListener interface and passing that
obj into

button.addActionListener(obj);

In this method we cant access the private variables of the
class that call button.addActionListener();

Is This Answer Correct ?    7 Yes 4 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Name some classes present in java.util.regex package.

1079


What is tcp and udp?

1074


What do you understand by java?

1048


What is an example of a conditional statement?

1103


If goto and const is reserve words than why it is not work in java?

2027


What is int short for?

1116


What is the collection interface?

1061


Do extraneous variables affect validity?

959


Explain the features of java?

1069


How do you initialize an arraylist in java?

1101


Difference between ‘is-a’ and ‘has-a’ relationship in java?

1045


What are the four corner stones of oop?

1082


Can we use synchronized block for primitives?

1131


What is stack explain?

1081


What is tree node in java?

1007