A listener is an object that

A listener is an object that

a)       implements any type of interface
b)       is used to accept any form of input
c)       is an inner class to a class that has abstract methods
d)       waits for some action from the user
e)       uses the InputStreamReader class


Answer:  d.

Explanation:  The listener “listens” for a user action such as a mouse motion, a key entry or an activation of a GUI object (like a button) and then responds appropriately.  Listeners allow us to write programs that interact with the user whenever the user performs an operation as opposed to merely seeking input from the user at pre-specified times.


Enhancing Classes

Learn More Multiple Choice Question :