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

how to deploy tomcatserver to weblogic server? write d following steps?

1445


Is java call by value?

583


What is the size of int in 64-bit jvm?

547


What are scalar data types?

524


Is string is a data type in java?

587






Write a program to reverse array in place?

585


What is the parse method in java?

561


What do you understand by the term polymorphism?

625


How many bytes is a string java?

526


What is a line break example?

576


Can we convert list to set in java?

509


Define an applet in java?

627


Explain the JDB in depth & command line.

565


What is byte value?

553


What is a blocking method in Java?

601