Monday 26 March 2012

Adapter Classes

•Java provides special type of classes for event handling called as “Adapter Classes”.
•Generally when he implement a event listener interface, we must provide implementations for all the methods available in the interface.
•Adapter classes simplifies the above restriction of implementing all the methods available in the interfaces.
•The adapter classes provide empty implementations of all the methods available in the interfaces.
•Now we can override those methods and provide implementations for only those methods which we want in the program.


•For using adapter classes in your programs you must follow these steps:
1) Declare a class which extends one of the adapter classes.
2) Provide implementations for only those methods which we want in our programs.

No comments:

Post a Comment