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

Give the difference between the println method and sqrt method?

1134


What are the problems faced by java programmers who don't use layout managers?

1042


What is a method in programming?

1230


What is string :: npos?

1180


How do you add an element to an arraylist in java?

998


Is arraylist ordered?

1126


What's the difference between int and integer in java?

1234


Is zero a natural number?

1105


What are the advantages of java?

1037


What is the difference between static method and instance method in Java?

1291


What is connection class in java?

1013


Can we create object of inner class in java?

998


What is string length in java?

1003


what is the purpose of the wait(), notify(), and notifyall() methods? : Java thread

1048


What is the difference between access specifiers and access modifiers in java?

1241