Back to the 2023 paper

Module III: Basics of Web Programming

20232m

What is an event in delegation event model used by Java programming language?

(i) An event is an object that describes a state change in a source
(ii) An event is an object that describes a state change in processing
(iii) An event is an object that describes any change by the user and system
(iv) An event is a class used for defining objects, to create events

Worked SolutionAI Assisted

Answer

(i) An event is an object that describes a state change in a source

Step-by-step

  1. Java's Delegation Event Model represents an event as an object.
  2. The event describes a change or action involving an event source, such as a button being clicked.
  3. The source generates the event and a registered listener handles it.

Example

A button click can generate an ActionEvent, which is delivered to an ActionListener.

Final answer: (i)

Similar questions