1.

What is a listener in context to event handling?(a) A listener is a variable that is notified when an event occurs(b) A listener is a object that is notified when an event occurs(c) A listener is a method that is notified when an event occurs(d) None of the mentionedI got this question during an interview for a job.I want to ask this question from Event Handling Basics topic in section Event Handling of Java

Answer»

The correct choice is (b) A LISTENER is a object that is notified when an event occurs

To explain I would say: A listener is a object that is notified when an event occurs. It has two major requirements first, it MUST have been registered with one or more sources to receive NOTIFICATION about specific event types, and secondly it must implement methods to receive and PROCESS these notifications.



Discussion

No Comment Found

Related InterviewSolutions