A directory of Objective Type Questions covering all the Computer Science subjects. Here you can access and discuss Multiple choice questions and answers for various compitative exams and interviews.

1. Which of these packages contains all the classes and methods required for even handling in Java?
a. java.applet
b. java.awt
c. java.event
d. java.awt.event
View Answer Report Discuss Too Difficult!
Answer: (d).java.awt.event

2. What is an event in delegation event model used by Java programming language?
a. An event is an object that describes a state change in a source
b. An event is an object that describes a state change in processing
c. An event is an object that describes any change by the user and system
d. An event is a class used for defining object, to create events
View Answer Report Discuss Too Difficult!
Answer: (a).An event is an object that describes a state change in a source

3. Which of these methods are used to register a keyboard event listener?
a. KeyListener()
b. addKistener()
c. addKeyListener()
d. eventKeyboardListener()
View Answer Report Discuss Too Difficult!
Answer: (c).addKeyListener()

4. Which of these methods are used to register a mouse motion listener?
a. addMouse()
b. addMouseListener()
c. addMouseMotionListner()
d. eventMouseMotionListener()
View Answer Report Discuss Too Difficult!
Answer: (c).addMouseMotionListner()

5. 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
View Answer Report Discuss Too Difficult!
Answer: (b).A listener is a object that is notified when an event occurs

6. Event class is defined in which of these libraries?
a. java.io
b. java.lang
c. java.net
d. java.util
View Answer Report Discuss Too Difficult!
Answer: (d).java.util

7. Which of these methods can be used to determine the type of event?
a. getID()
b. getSource()
c. getEvent()
d. getEventObject()
View Answer Report Discuss Too Difficult!
Answer: (a).getID()

8. Which of these class is super class of all the events?
a. EventObject
b. EventClass
c. ActionEvent
d. ItemEvent
View Answer Report Discuss Too Difficult!
Answer: (a).EventObject

9. Which of these events will be notified if scroll bar is manipulated?
a. ActionEvent
b. ComponentEvent
c. AdjustmentEvent
d. WindowEvent
View Answer Report Discuss Too Difficult!
Answer: (c).AdjustmentEvent

10. Which of these events will be generated if we close an applet’s window?
a. ActionEvent
b. ComponentEvent
c. AdjustmentEvent
d. WindowEvent
View Answer Report Discuss Too Difficult!
Answer: (d).WindowEvent

Page 1 of 5