AJP ComponentEvent MCQ
AJP ComponentEvent MCQ
Ans. b) getchild()
3.FocusEvent is subclass of which of these classes?
a) ComponentEvent
b) ContainerEvent
c) ItemEvent
d) InputEvent
Ans. a) ComponentEvent
4.Which of these is superclass of ContainerEvent class?
a) WindowEvent
b) ComponentEvent
c) ItemEvent
d) InputEvent
Ans. b)ComponentEvent
5.Which of these events is generated when the component is added or removed?
a) ComponentEvent
b) ContainerEvent
c) FocusEvent
d) InputEvent
Ans. b) ContainerEvent
a) COMPONENT_HIDDEN
b) COMPONENT_MOVED
c) COMPONENT_RESIZE
d) All of the mentioned
a) Window
b) RadioButton
c) ScrollBar
d) None of these
Ans. d) None of these
8. Which of these is super class of WindowEvent class?
a) ComponentEvent
b) ContainerEvent
c) MouseEvent
d) KeyEvent
Ans. a)ComponentEvent
9.Which of these not a constants defined in ComponentEvent class?
a) COMPONENT_HIDDEN
b) COMPONENT_MOVED
c) COMPONENT_RESIZE
d) COMPONENT_SIZE
Ans. d) COMPONENT_SIZE
10. Which of the following components generate action events?
a) Buttons
b) Labels
c)Check boxes
d)Windows
Ans: a) Buttons
12. __________are used to invoke events on the parent component from child components in
the hierarchy of components.
a) Inputs
b) Outputs
c) Blueprints
d) hooks
Ans. b) Outputs
13. Components are basically directives with views but we cannot implement them by
nesting/composing other directives and components.
a) True
b) False
Ans. b) False
14. Components conduct a provider lookup upwards because each component has its own
built-in _________ which is specific to it.
a) service
b) instance
c) hook
d) injector
Ans. d) injector
15. A component is a class decorated with some metadata and ________ are functions that can
modify a class.
a) Selectors
b) Decorators
c) Mentors
d) Bindings
Ans. b) Decorators
16. The superclass of ContainerEvent, FocusEvent and WindowEvent is _________
a) ActionEvent
b) ItemEvent
c) KeyEvent
d) ComponentEvent
Ans. d) ComponentEvent
17. Which methods are defined by ComponentListener
a) void componentHidden(ComponentEvent obj)
b) void componenthidden(componentevent obj)
c) void Componenthidden(ComponentEvent obj)
d) None of these
Ans. a) void componentHidden(ComponentEvent obj)
18. Which of these methods is used to obtain the object that generated a ComponentEvent.
a) GetContainer()
b) getContainer()
c) getcontainer()
d) None of these
Ans. b) getContainer()
19. windowEvent is a subclass of _________________
a) ComponentEvent()
b) Componentevent()
c) componentevent()
d) None of these
Ans. a) ComponentEvent()
20. If we close an applet window _________ events will be generated
a) ActionEvent
b) ComponentEvent
c) AdjustmentEvent
d) WindowEvent
Ans. d) WindowEvent
21. A ComponentEvent is generated when the size, ________, or visibility of a component is
changed.
a) position
b) place
c) Both (a) & (b)
d) None of these
Ans. a) position
22. Which class defines integer constants that can be used to identify them.
a) ItemEvent
b) ComponentEvent
c) KeyEvent
d) None of these
Ans. b) ComponentEvent
23. The COMPONENT_HIDDEN constants meaning is ___________.
a) The component was moved.
b) The component was resized.
c) The component was hidden.
d) None of these
Ans. c) The component was hidden.
24. Which of these ComponentEvent Constructor.
a) ComponentEvent(Component src, int type)
b) componentevent(Component src, int type)
c) Componentevent(Component src, int type)
d) None of these.
Ans. a) ComponentEvent(Component src, int type)
25. Which of these is superclass of FocusEvent class.
a) Component event
b) componentevent
c) WindowEvent
d) ComponentEvent
Ans. d) ComponentEvent
26. Which of these is superclass of MouseEvent class.
a) ComponentEvent
b) componentevent
c) WindowEvent
d) None of these
Ans. d) ComponentEvent.
27. Which method returns the component that generated the event.
a) GetComponent()
b) getComponent()
c) getcomponent()
d) None of these
Ans. b) getComponent().
28. The getComponent() method returns the component that generated the ________.
a) event
b) object
c) All of these
d) None of these
Ans. a) event
29. Which of these methods can be used to get reference to a component that was added from a
container.
a) getComponentChild()
b) getComponent()
c) getchild()
d) None of these
Ans. c) getchild()
30. What is the use of getChild() method.
a) component added to or removed.
b) component created
c) Both (a) & (b)
d) None of these
Ans. a) component added to or removed.