0% found this document useful (0 votes)
15 views

unit 3 java mcq

The document outlines key concepts related to event handling in Java, including the implementation of the Listener interface and the delegation event model. It covers various types of events, the use of ActionListener, and the necessary steps for handling events. Additionally, it highlights the importance of the java.awt.event package for event handling.

Uploaded by

adigenshin1611
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
15 views

unit 3 java mcq

The document outlines key concepts related to event handling in Java, including the implementation of the Listener interface and the delegation event model. It covers various types of events, the use of ActionListener, and the necessary steps for handling events. Additionally, it highlights the importance of the java.awt.event package for event handling.

Uploaded by

adigenshin1611
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

1.

The following steps are required to perform: 1) Implement the Listener interface and
override its methods. 2) Register the component with the Listener.
Answer Options:
o A. Exception Handling
o B. String Handling
o C. Event Handling
o D. None of the above
Correct Answer: C.

2. What is an event in the delegation event model used by Java programming language?
Answer Options:
o A. An event is an object that describes a state change in a source.
o B. An event is an object that describes a state change in processing.
o C. An event is an object that describes any change by the user and system.
o D. An event is a class used for defining objects to create events.
Correct Answer: A

3. Which of these events will be notified if a scroll bar is manipulated?


Answer Options:
o A. ActionEvent
o B. ComponentEvent
o C. AdjustmentEvent
o D. WindowEvent
Correct Answer: C

4. The ActionListener interface is used for handling action events. For example, it's used
by
Answer Options:
o A. JButton
o B. JCheckBox
o C. JMenuItem
o D. All of these
Correct Answer: D

5. We use the inner class concept in event handling in Java by Adapter classes.
Answer Options:
o A. TRUE
o B. FALSE
Correct Answer: A
6. The event Delegation Model consists of the following steps: 1. Component generates
events. 2. Event object is prepared and passed to registered listener who will handle
the event.
Answer Options:
o A. Only 1 follows
o B. Only 2 follows
Correct Answer: B

7. The Following steps are required to perform: 1) Implement the Listener interface and
override its methods. 2) Register the component with the Listener.
Answer Options:
o A. Exception Handling
o B. String Handling
o C. Event Handling
o D. Action Handling
Correct Answer: C

8. To listen to mouse click events, the listener must implement the __________ interface
or extend the _______ adapter.
Answer Options:
o A. MouseListener / MouseAdapter
o B. MouseMotionListener / MouseMotionAdapter
o C. WindowListener / WindowAdapter
o D. ComponentListener / ComponentAdapter
Correct Answer: A

9. In Java, an event is an _______which specifies the change of state in the source.


Answer Options:
o A. Class
o B. Object
o C. Int
o D. String
Correct Answer: B

10. A source generates an event and sends it to ___________ listeners that can handle the
event.
Answer Options:
o A. One
o B. Two
o C. One or more
o D. None of these
Correct Answer: C
11. The Delegation Event Model is based on the concept of ____________
Answer Options:
o A. Source
o B. Listener
o C. Both a & b
o D. None of these
Correct Answer: C

12. Which of the following package contains all the classes and methods required for
event handling in Java.
Answer Options:
o A. java.awt
o B. java.event
o C. java.awt.event
o D. All of these
Correct Answer: C

You might also like