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

Can we convert stringbuilder to string in java?

986


What is the final field modifier?

974


Can we able to pass objects as an arguments in java?

1022


Can a final variable be null?

1016


Is array an object in java?

959


Is an array a vector?

1043


What is generic class?

1092


Is it necessary for the port addresses to be unique? Explain with reason.

1018


What is :: operator in java?

970


Which java version is latest?

1031


describe synchronization in respect to multithreading? : Java thread

925


Can we have any code between try and catch blocks?

988


Can we have try without catch block?

1080


Write a program to solve producer consumer problem in java?

1011


Is java se open source?

1030