adapter class ?

Answer Posted / janet

An adapter class provides an empty implementation of all
methods in an event listener interface.Adapter classes are
useful when you want to receive and process only some of
the events that are handled by a particular event listener
interface.you can define a new class to act lisener by
extending one of the adapter classes and implementing onlu
those events in which you are interested.
For ex: the MouseMotionListenerAdapter class has two
methods,mouseDragged() and mouseMoved(). The signatures of
these empty are exactly as defined in the
MouseMotionListener interface. If you are interested in
onlu mouse drag events,that you could simply extend
MouseMotionAdapter and implement mouseDragged().

Is This Answer Correct ?    3 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What does split function do in java?

759


What is java used for?

787


What is meant by distributed application? Why are we using that in our application?

764


Can we call virtual funciton in a constructor ?

1961


Can an arraylist be empty?

791


EDS (Electronic Data Systems India Pvt Ltd) at Chennai on 16-12-2006.

8904


What is java command?

799


How will you call an Applet using Java Script Function?

761


Explain inheritance in java?

788


What is the full name of java?

818


What is the console in java?

913


Explain the inheritance?

771


Write a code to show a static variable?

846


What is the difference between choice and list?

846


What is identifier with example?

804