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

Detail discussions on JVM, memory management and garbage collector.

744


Can private class be extended java?

764


What is high level language in computer?

752


What will happen if static modifier is removed from the signature of the main method?

719


Is string is a class in java?

697


Which command from the jdk compiles a java program?

675


Can a serialized object be transferred via network?

698


Tell me the latest versions in java related areas?

829


What is int argc char * argv?

788


What is immutable state?

729


What is the difference between double and float variables in java?

851


What is the maximum size of list in java?

729


is there a separate stack for each thread in java? : Java thread

775


Can I learn java without any programming experience?

783


What is adapter in java?

712