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 can we make string upper case or lower case?

593


When do you call copy constructor?

554


What is meant by stack and queue?

598


What is a function in programming?

547


Give differences between Quicksort &Mergesort. When should these sorts be used andwhat is their running time in java?

676






What is the use of 'super' keyword inside a constructor?

554


Is string serializable in java?

538


What is derived datatype?

623


Why can't we use static class instead of singleton?

497


How do you remove all elements from an arraylist in java?

501


Do you know how to reverse string in java?

578


What is equlas() and hashcode() contract in java? Where does it used?

602


Explain the difference between an object-oriented programming language and object-based programming language?

543


Can we convert stringbuffer to string?

561


How can we access some class in another class in java?

541