Deck 5: Java Inputoutput and Event Handling

Full screen (f)
exit full mode
Question
The ________ method help in clearing the contents of the buffer:

A)flush()
B)clear()
C)rub()
D)vanish()
Use Space or
up arrow
down arrow
to flip the card.
Question
The _______ class is used to write bytes to a file:

A)FileInputStream
B)FileOutputStream
C)FileBufferStream
D)FileStringStream
Question
The _______ class is used to read characters from the file:

A)StreamReader
B)CharacterReader
C)InputReader
D)FileReader
Question
DataInputStream class contains methods to read________

A)Non primitive data type
B)Primitive data type
C)Formatted data
D)all of the above
Question
Whenever the applet requires to redraw its output, it is done by using method

A)display()
B)paint()
C)displayApplet()
D)PrintApplet()
Question
Which of these methods can be used to output a string in an applet?

A)display()
B)print()
C)drawString()
D)transient()
Question
What does AWT stands for?

A)All Window Tools
B)All Writing Tools
C)Abstract Window Toolkit
D)Abstract Writing Toolkit
Question
Which of these packages contains all the classes and methods required for event handling in Java? a) jav

A)applet
B)java.awt
C)java.event
D)java.awt.event
Question
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.
Question
Which of these methods are used to register a keyboard event listener?

A)KeyListener()
B)addKistener()
C)addKeyListener()
D)eventKeyboardListener()
Question
Which of these methods are used to register a MouseMotionListener?

A)addMouse()
B)addMouseListener()
C)addMouseMotionListner()
D)eventMouseMotionListener()
Question
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 an interface 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
Question
Which of these class is super class of all AWT events?

A)AWTEvent
B)EventClass
C)ActionEvent
D)ItemEvent
Question
Which of these events will be generated if scroll bar is manipulated?

A)ActionEvent
B)ComponentEvent
C)AdjustmentEvent
D)WindowEvent
Question
Which of these events will be generated if we close a Frame window?

A)ActionEvent
B)ComponentEvent
C)AdjustmentEvent
D)WindowEvent
Question
Which of these events is generated when a button is pressed?

A)ActionEvent
B)KeyEvent
C)WindowEvent
D)AdjustmentEvent
Question
Which of these methods can be used to obtain the command name for ActionEvent object?

A)getCommand()
B)getActionCommand()
C)getActionEvent()
D)getActionEventCommand()
Question
Which of these methods in KeyEvent class can be used to know which key is pressed?

A)getKeyCode()
B)getModifier()
C)getActionKey()
D)getActionEvent()
Question
Which of these interfaces define a method actionPerformed()?

A)ComponentListener
B)ContainerListener
C)ActionListener
D)InputListener
Question
Which of these interfaces define a method itemStateChanged()?

A)ComponentListener
B)ContainerListener
C)ActionListener
D)ItemListener
Question
What are the sequences of method executed when an Applet starts execution?

A)init(),start(),stop(),destroy()
B)load(),start(),stop(),unload()
C)init(),activate(),deactivate(),destroy()
D)start(),init(),destroy(),stop()
Question
The default layout manager of an Applet is

A)Flowlayout
B)Gridlayout
C)BorderLayout
D)BoxLayout
Question
The default layout manager of a Frame is

A)Flowlayout
B)Gridlayout
C)BorderLayout
D)BoxLayout
Question
Which package consist an applet class?

A) java.applet
B)java.awt
C)java.awt.applet
D)java.event
Unlock Deck
Sign up to unlock the cards in this deck!
Unlock Deck
Unlock Deck
1/24
auto play flashcards
Play
simple tutorial
Full screen (f)
exit full mode
Deck 5: Java Inputoutput and Event Handling
1
The ________ method help in clearing the contents of the buffer:

A)flush()
B)clear()
C)rub()
D)vanish()
flush()
2
The _______ class is used to write bytes to a file:

A)FileInputStream
B)FileOutputStream
C)FileBufferStream
D)FileStringStream
FileOutputStream
3
The _______ class is used to read characters from the file:

A)StreamReader
B)CharacterReader
C)InputReader
D)FileReader
FileReader
4
DataInputStream class contains methods to read________

A)Non primitive data type
B)Primitive data type
C)Formatted data
D)all of the above
Unlock Deck
Unlock for access to all 24 flashcards in this deck.
Unlock Deck
k this deck
5
Whenever the applet requires to redraw its output, it is done by using method

A)display()
B)paint()
C)displayApplet()
D)PrintApplet()
Unlock Deck
Unlock for access to all 24 flashcards in this deck.
Unlock Deck
k this deck
6
Which of these methods can be used to output a string in an applet?

A)display()
B)print()
C)drawString()
D)transient()
Unlock Deck
Unlock for access to all 24 flashcards in this deck.
Unlock Deck
k this deck
7
What does AWT stands for?

A)All Window Tools
B)All Writing Tools
C)Abstract Window Toolkit
D)Abstract Writing Toolkit
Unlock Deck
Unlock for access to all 24 flashcards in this deck.
Unlock Deck
k this deck
8
Which of these packages contains all the classes and methods required for event handling in Java? a) jav

A)applet
B)java.awt
C)java.event
D)java.awt.event
Unlock Deck
Unlock for access to all 24 flashcards in this deck.
Unlock Deck
k this deck
9
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.
Unlock Deck
Unlock for access to all 24 flashcards in this deck.
Unlock Deck
k this deck
10
Which of these methods are used to register a keyboard event listener?

A)KeyListener()
B)addKistener()
C)addKeyListener()
D)eventKeyboardListener()
Unlock Deck
Unlock for access to all 24 flashcards in this deck.
Unlock Deck
k this deck
11
Which of these methods are used to register a MouseMotionListener?

A)addMouse()
B)addMouseListener()
C)addMouseMotionListner()
D)eventMouseMotionListener()
Unlock Deck
Unlock for access to all 24 flashcards in this deck.
Unlock Deck
k this deck
12
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 an interface 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
Unlock Deck
Unlock for access to all 24 flashcards in this deck.
Unlock Deck
k this deck
13
Which of these class is super class of all AWT events?

A)AWTEvent
B)EventClass
C)ActionEvent
D)ItemEvent
Unlock Deck
Unlock for access to all 24 flashcards in this deck.
Unlock Deck
k this deck
14
Which of these events will be generated if scroll bar is manipulated?

A)ActionEvent
B)ComponentEvent
C)AdjustmentEvent
D)WindowEvent
Unlock Deck
Unlock for access to all 24 flashcards in this deck.
Unlock Deck
k this deck
15
Which of these events will be generated if we close a Frame window?

A)ActionEvent
B)ComponentEvent
C)AdjustmentEvent
D)WindowEvent
Unlock Deck
Unlock for access to all 24 flashcards in this deck.
Unlock Deck
k this deck
16
Which of these events is generated when a button is pressed?

A)ActionEvent
B)KeyEvent
C)WindowEvent
D)AdjustmentEvent
Unlock Deck
Unlock for access to all 24 flashcards in this deck.
Unlock Deck
k this deck
17
Which of these methods can be used to obtain the command name for ActionEvent object?

A)getCommand()
B)getActionCommand()
C)getActionEvent()
D)getActionEventCommand()
Unlock Deck
Unlock for access to all 24 flashcards in this deck.
Unlock Deck
k this deck
18
Which of these methods in KeyEvent class can be used to know which key is pressed?

A)getKeyCode()
B)getModifier()
C)getActionKey()
D)getActionEvent()
Unlock Deck
Unlock for access to all 24 flashcards in this deck.
Unlock Deck
k this deck
19
Which of these interfaces define a method actionPerformed()?

A)ComponentListener
B)ContainerListener
C)ActionListener
D)InputListener
Unlock Deck
Unlock for access to all 24 flashcards in this deck.
Unlock Deck
k this deck
20
Which of these interfaces define a method itemStateChanged()?

A)ComponentListener
B)ContainerListener
C)ActionListener
D)ItemListener
Unlock Deck
Unlock for access to all 24 flashcards in this deck.
Unlock Deck
k this deck
21
What are the sequences of method executed when an Applet starts execution?

A)init(),start(),stop(),destroy()
B)load(),start(),stop(),unload()
C)init(),activate(),deactivate(),destroy()
D)start(),init(),destroy(),stop()
Unlock Deck
Unlock for access to all 24 flashcards in this deck.
Unlock Deck
k this deck
22
The default layout manager of an Applet is

A)Flowlayout
B)Gridlayout
C)BorderLayout
D)BoxLayout
Unlock Deck
Unlock for access to all 24 flashcards in this deck.
Unlock Deck
k this deck
23
The default layout manager of a Frame is

A)Flowlayout
B)Gridlayout
C)BorderLayout
D)BoxLayout
Unlock Deck
Unlock for access to all 24 flashcards in this deck.
Unlock Deck
k this deck
24
Which package consist an applet class?

A) java.applet
B)java.awt
C)java.awt.applet
D)java.event
Unlock Deck
Unlock for access to all 24 flashcards in this deck.
Unlock Deck
k this deck
locked card icon
Unlock Deck
Unlock for access to all 24 flashcards in this deck.