In Java event handling, what is the purpose of the `getSource()` method of the `ActionEvent` class?
A. It returns the object that generated the event
B. It returns the event listener object
C. It returns the event source
D. It returns the event type
Answer: Option A
A. An action or occurrence to which a program can respond
B. A Java class that handles exceptions
C. A type of exception
D. A data type
In Java event handling, what is an event source?
A. An event listener
B. A keyword used to declare events
C. A method that handles events
D. An object that generates events
Which package in Java contains classes for event handling?
A. `java.util`
B. `java.swing`
C. `java.awt.event`
D. `java.io`
What is an event listener in Java?
A. A Java class that generates events
B. An object that listens for events and responds to them
C. A method that handles events
D. A Java class that generates events
Join The Discussion