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 / reddy vatti

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 ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Is char a method in java?

1016


What are the 6 mandatory procedures for iso 9001?

946


What is return null in java?

900


How would you format a date in java? I.e. In the ddmmyyy format?

1316


What happens when you add a double value to a string?

934


Difference between method overloading and method overriding in java ?

1022


Is it possible for yielded thread to get chance for its execution again ?

962


When should the method invokelater() be used?

972


Can we declare a static variable inside a method?

954


What are the four pillars of java?

1157


Can we start a thread twice in java?

909


What is bufferedreader in java?

997


How the interruptible method gets implemented?

913


What is a parameter example?

926


What is a nested class?

1055