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

Advanced_Java_All_Questions (1)

The document contains a series of multiple-choice questions related to advanced Java programming, specifically focusing on event handling. Topics include event classes, listener interfaces, and methods for registering events. It serves as a quiz or study guide for individuals looking to test their knowledge in Java event handling concepts.
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)
4 views

Advanced_Java_All_Questions (1)

The document contains a series of multiple-choice questions related to advanced Java programming, specifically focusing on event handling. Topics include event classes, listener interfaces, and methods for registering events. It serves as a quiz or study guide for individuals looking to test their knowledge in Java event handling concepts.
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/ 5

Advanced Java Programming - Questions with Multiple Choices

1. Which class is the superclass of all the events in Java?

A) EventObject

B) EventSource

C) ComponentEvent

D) AWTEvent

2. Which package contains all the classes and methods required for event handling in Java?

A) java.awt

B) java.awt.event

C) java.util

D) javax.swing.event

3. Which event is generated when a window is closed?

A) WindowEvent

B) ActionEvent

C) ComponentEvent

D) ContainerEvent

4. Which method is used to register a keyboard event listener?

A) addKeyListener()

B) registerKeyListener()

C) setKeyListener()

D) keyListener()

5. Which method can be used to know the degree of adjustment made by the user?

A) getAdjustment()

B) getValue()
C) setAdjustment()

D) getDegree()

6. A MenuItem object can generate __________ events.

A) ActionEvent

B) ItemEvent

C) MenuEvent

D) KeyEvent

7. A source generates an event and sends it to ___________ listeners that can handle the

event.

A) Exactly one

B) One or more

C) None

D) Unlimited

8. A ________________ is an object that is notified when an event occurs.

A) Source

B) Listener

C) EventObject

D) Adapter

9. A ________________________ is generated when a component is added to or removed

from a container.

A) ActionEvent

B) ItemEvent

C) ContainerEvent

D) FocusEvent
10. ActionEvent Class is used for which controls?

A) Button

B) List

C) MenuItem

D) All of the above

11. Adapter class belongs to the package:

A) java.awt

B) java.awt.event

C) java.util

D) javax.swing.event

12. Adapter Class provides:

A) Default implementation

B) Empty implementation of all methods of a listener

C) All methods

D) None of the above

13. An event is generated when the internal state of the event source is ___________.

A) Changed

B) Not changed

C) Read-only

D) Static

14. An object that would like to be notified of and respond to an event is:

A) EventListener

B) SourceListener

C) AdapterListener

D) All of the above


15. At the root of the Java event class hierarchy is ___________ which is the superclass for

all events.

A) Event

B) EventObject

C) ObjectEvent

D) Listener

16. Change in the state of an object is known as __________.

A) Event

B) Source

C) ObjectEvent

D) None of the above

17. CheckBox implements following Listener Interface:

A) ItemListener

B) KeyListener

C) ActionListener

D) None

18. ComponenetEvent is the superclass of _______________.

A) ContainerEvent

B) All of the above

C) ComponentEvent

D) None of the above

19. Event class is defined in which of these libraries?

A) java.awt

B) java.awt.event

C) java.util
D) javax.swing

20. Event Listeners are:

A) Interfaces

B) Abstract Classes

C) Enums

D) Methods

You might also like