Top 250+ Solved Java Programming MCQ Questions Answer

From 211 to 225 of 285

Q. The _______ class is used to read characters from the file:

a. StreamReader

b. CharacterReader

c. InputReader

d. FileReader

  • d. FileReader

Q. DataInputStream class contains methods to read________

a. Non primitive data type

b. Primitive data type

c. Formatted data

d. all of the above

  • b. Primitive data type

Q. Whenever the applet requires to redraw its output, it is done by using method

a. display()

b. paint()

c. displayApplet()

d. PrintApplet()

  • b. paint()

Q. Which of these methods can be used to output a string in an applet?

a. display()

b. print()

c. drawString()

d. transient()

  • c. drawString()

Q. What does AWT stands for?

a. All Window Tools

b. All Writing Tools

c. Abstract Window Toolkit

d. Abstract Writing Toolkit

  • c. Abstract Window Toolkit

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

  • d. java.awt.event

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

  • a. An event is an object that describes a state change in a source.

Q. Which of these methods are used to register a keyboard event listener?

a. KeyListener()

b. addKistener()

c. addKeyListener()

d. eventKeyboardListener()

  • c. addKeyListener()

Q. Which of these methods are used to register a MouseMotionListener?

a. addMouse()

b. addMouseListener()

c. addMouseMotionListner()

d. eventMouseMotionListener()

  • c. addMouseMotionListner()

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

  • b. A listener is an interface that is notified when an event occurs.

Q. Which of these class is super class of all AWT events?

a. AWTEvent

b. EventClass

c. ActionEvent

d. ItemEvent

  • a. AWTEvent

Q. Which of these events will be generated if scroll bar is manipulated?

a. ActionEvent

b. ComponentEvent

c. AdjustmentEvent

d. WindowEvent

  • d. WindowEvent

Q. Which of these events will be generated if we close a Frame window?

a. ActionEvent

b. ComponentEvent

c. AdjustmentEvent

d. WindowEvent

  • d. WindowEvent

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

a. ActionEvent

b. KeyEvent

c. WindowEvent

d. AdjustmentEvent

  • a. ActionEvent

Q. Which of these methods can be used to obtain the command name for ActionEvent object?

a. getCommand()

b. getActionCommand()

c. getActionEvent()

d. getActionEventCommand()

  • b. getActionCommand()
Subscribe Now

Get All Updates & News