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

What is incompatible types in java?

1042


How can you say java is object oriented?

1075


Can we make a constructor final?

1022


What are 4 pillers of object orinted programming?

1017


How do you check if a number is a perfect square?

994


Justify your answer that you can't define a method inside another method in java, if you can then how?

1182


What is the technique adopted to create an immutable class?

1116


What is meant by design patterns?

1037


Can we have two methods in a class with the same name?

1054


What is difference between string and new string?

1037


Why do we use regex?

1034


What do you know about the garbate collector?

1023


Where is the singleton class used?

1031


What is the difference between == and === javascript?

1187


What is the latest java version?

1067