Nothing Special   »   [go: up one dir, main page]

MCQ of Unit 3 AJP

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 7

CHAPTER-3 (Event Handling)

Q1. Which of these events generated when a button is pressed?


a) WindowEvent
b) ActionEvent
c) KeyEvent
d) ActionEvent

Q2. Method use to change the location of event?


a) getPoint()
b) translatePoint()
c) getClickCount()
d) isPopupTrigger()

Q3. Which method will be invoked if a character is entered?


a) KeyPressed()
b) KeyReleased()
c) KeyTyped()
d) KeyEntered()

Q4. Which of these is a super class of all adapter class?


a) Applet
b) Event
c) ComponentEvent
d) InputEvent

Q5. Which method used to obtain co-ordinates of a mouse?


a) getPoint()
b) GetCoordinates()
c) GetMouseXY()
d) GetMouseCoordinates()

Q6. Which of these is a super class of all ContainerEvent class?


a) WindowEvent
b) ComponentEvent
c) ItemEvent
d) InputEvent

Q7. Which of these class is super class of all events?


a) EventObject
b) EventClass
c) ActionEvent
d) ItemEvent
Q8. ____is a superclass of windowEvent class
a) WindowEvent
b) ComponentEvent
c) ItemEvent
d) InputEvent

Q9. Which of these package contains all the event handling interfaces?
a) Java.lang
b) Java.awt
c) Java.awt.event
d) Java.event

Q10. Name of event classes?


a) ActionEvent,ComponentEvent
b) ContainerEvent,FocusEvent
c) ItemEvent,KeyEvent
d) All of these

Q11. Event object class belongs to


a) Java.util
b) Java.awt
c) Java.lang
d) Java.sql

Q12. _____method is defined in mousemotionAdapter class


a) MouseDragged()
b) MousePressed()
c) MouseReleased()
d) MouseClicked()

Q13. Which of these constant value will change when the button at the end of scrollbar was
clicked to increase its value?
a) BLOCK_DECREMENT
b) BLOCK_INCREMENT
c) UNIT_DECREMENT
d) UNIT_INCREMENT

Q14. For which Interface method belongs to void adjustmentValueChanged(AdjustmentEvent


e)?
a) ObjectListener
b) AdjustmentListener
c) ActionListener
d) ComponentListener
Q15. For which class this constant belongs to BLOCK_DECREMENT and
BLOCK_INCREMENT?
a) Scrollbar
b) Menubar
c) Filedialog
d) Actionevent

Q16. Which of these events is generated when the size of component is changed?
a) ComponentEvent
b) ContainerEvent
c) FocusEvent
d) InputEvent

Q17. Which of these events is generated when the component is added or removed?
a) ComponentEvent
b) ContainerEvent
c) FocusEvent
d) InputEvent

Q18. Which of these are integer constants of ComponentEvent class?


a) COMPONENT_HIDDEN
b) COMPONENT_MOVED
c) COMPONENT_RESIZE
d) All of These

Q19. Which of these events is generated when computer gains or losses input focus?
a) ComponentEvent
b) ContainerEvent
c) FocusEvent
d) InputEvent

Q20. Base class of all AWT Event class is


a) AwtEvent
b) KeyEvent
c) ActionEvent
d) AdjustmentEvent

Q21. Which of these event generated when a button is Pressed?


a) window Event
b) ActionEvent
c) KeyEvent
d) MouseEvent
Q22. Which is the class responsible for handling key press activity?
a) KeyEvent
b) WindowEvent
c) ActionEvent
d) mouseEvent

Q23. Event class library is define in following package


a) java.io
b) java.util
c) java.event
d) java.object

Q24. ComponentEvent is a super class of __________


a) Container Event
b) FocusEvent
c) both a and b
d) None of these

Q25. TextEvent defines integer constant


a) TEXT_VALUE_CHANGED
b) TEXT_VALUE
c) both a and b
d) None of these

Q26. ____ is the abstract super class of all component input event class
a) KeyEvent
b) ItemEvent
c) ActionEvent
d) InputEvent

Q27. Event is called as


a) change in the state of object
b) change in the state of variable
c) ActionEvent
d) InputEvent

Q28. What is listener in context to event handling?


a) is a variable that is notified when an event occurs
b) is an object that is notified when an event occurs
c) A listener is a method that is notified when an event occurs
d) None of these

Q29. Event class is defined in which of these libraries


a) java.io
b) java.lang
c) java.net
d) java.util

Q30. Which of these method are used to register a keyboard event listener?
a) KeyListener()
b) ADDKeyListener()
c) addKeyListener()
d) eventKeyboardListener()

Q31. Which of these class is super class of all the events?


a) EventObject
b) EventClass
c) ActionEvent
d) ItemEvent
a) UNIT_INCREMENT

Q32. Which of these methods can be used to know which key is pressed?
a) getKey()
b) getModifier()
c) getActionKey()
d) getActionEvent()

Q33. Which of these methods can be used to obtain the coordinates of a mouse?
a) getPoint()
b) getCoordinates()
c) GetMouseXY()
d) getMouseCoordinates()

Q34. Which of these is superclass of container Event class?


a) windowEvent
b) ComponentEvent
c) ItemEvent
d) InputEvent

Q35. Which of these is superclass of all adapter classes?

a) Applet
b) ComponentEvent
c) Event
d) InputEvent

Q36. ____method are used to register a mousemotion listener


a) addMouse()
b) addMouseListener()
c) addMouseMotionListener()
d) eventMouseMotionListener()

Q37. ___is used to obtain the object that generated a windowEvent.


a) getMethod()
b) getWindow()
c) getWindowEvent()
d) getWindowObject()

Q38. MouseEvent is subclass of___classes.


a) ComponentEvent
b) ContainerEvent
c) ItemEvent
d) InputEvent

Q39. ___is superclass of windowEvent class.


a) windowEvent
b) ComponentEvent
c) ItemEvent
d) InputEvent

Q40. 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

Q41. What is an event delegation model used by Java programming languages?


a) An event is an object that describe a state change in a source.
b) An event is an object that describe a state change in a processing.
c) An event is an object that describe a any changes by the user and system
d) An event is a class used for defining object, to create events.

Q42. Which of these packages contains all the event handling interfaces?
a) java.lang
b) java.awt
c) java.awt.event
d) java.event

Q43. Which of these methods is defined in MouseMotionAdapter class?


a) mouseDragged()
b) mousePressed()
c) mouseReleased()
d) mouseClicked()

Q44. Interface used to handle menu event is


a) ActionListener
b) ItemListener
c) ComponentListener
d) ContainerListener

Q45. Action event is applied on


a) Button, textFiel, text , menu
b) Button,TextField,Label
c) Button, Menu
d) TextField,Menu

You might also like