in Education by
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 mentioned I 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 Select the correct answer from above options

1 Answer

0 votes
by
 
Best 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.

Related questions

0 votes
    Which of these methods are used to register a keyboard event listener? (a) KeyListener() (b) addKistener() ( ... Event Handling of Java Select the correct answer from above options...
asked Feb 24, 2022 in Education by JackTerrance
0 votes
    Which of these packages contains all the event handling interfaces? (a) java.lang (b) java.awt (c) java.awt ... Event Handling of Java Select the correct answer from above options...
asked Feb 24, 2022 in Education by JackTerrance
0 votes
    Which of these methods are used to register a mouse motion listener? (a) addMouse() (b) addMouseListener() ( ... Event Handling of Java Select the correct answer from above options...
asked Feb 24, 2022 in Education by JackTerrance
0 votes
    Which of these packages contains all the classes and methods required for even handling in Java? (a) java.applet ... Handling of Java Select the correct answer from above options...
asked Feb 24, 2022 in Education by JackTerrance
0 votes
    What is an event in delegation event model used by Java programming language? (a) An event is an object that ... Event Handling of Java Select the correct answer from above options...
asked Feb 24, 2022 in Education by JackTerrance
0 votes
    Event class is defined in which of these libraries? (a) java.io (b) java.lang (c) java.net (d) ... division Event Handling of Java Select the correct answer from above options...
asked Feb 24, 2022 in Education by JackTerrance
0 votes
    Which of these methods can be used to determine the type of event? (a) getID() (b) getSource() (c) ... chapter Event Handling of Java Select the correct answer from above options...
asked Feb 24, 2022 in Education by JackTerrance
0 votes
    Which of these methods can be used to determine the type of adjustment event? (a) getType() (b) getEventType ... Event Handling of Java Select the correct answer from above options...
asked Feb 24, 2022 in Education by JackTerrance
0 votes
    Which of these events is generated when the size of an event is changed? (a) ComponentEvent (b) ContainerEvent ... Handling of Java Select the correct answer from above options...
asked Feb 24, 2022 in Education by JackTerrance
0 votes
    Which of these methods can be used to change location of an event? (a) ChangePoint() (b) TranslatePoint() ( ... Event Handling of Java Select the correct answer from above options...
asked Feb 24, 2022 in Education by JackTerrance
0 votes
    Which of these interfaces handles the event when a component is added to a container? (a) ComponentListener (b) ... Handling of Java Select the correct answer from above options...
asked Feb 24, 2022 in Education by JackTerrance
0 votes
    Which of these class is super class of all the events? (a) EventObject (b) EventClass (c) ActionEvent (d) ... Event Handling of Java Select the correct answer from above options...
asked Feb 24, 2022 in Education by JackTerrance
0 votes
    Which of these events will be notified if scroll bar is manipulated? (a) ActionEvent (b) ComponentEvent (c) ... Event Handling of Java Select the correct answer from above options...
asked Feb 24, 2022 in Education by JackTerrance
0 votes
    Which of these events is generated when a button is pressed? (a) ActionEvent (b) KeyEvent (c) WindowEvent (d ... Event Handling of Java Select the correct answer from above options...
asked Feb 24, 2022 in Education by JackTerrance
0 votes
    Which of these methods can be used to obtain the command name for invoking ActionEvent object? (a) getCommand() ... Handling of Java Select the correct answer from above options...
asked Feb 24, 2022 in Education by JackTerrance
...