Java MCQs with answers Page - 32

Here, you will find a collection of MCQ questions on Java. Go through these questions to enhance your preparation for upcoming examinations and interviews.

To check the correct answer, simply click the View Answer button provided for each question.

Have your own questions to contribute? Click the button below to share your MCQs with others!

+ Add Question

A

Admin • 832.27K Points
Coach

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

  • (A) ActionEvent
  • (B) ComponentEvent
  • (C) AdjustmentEvent
  • (D) WindowEvent

A

Admin • 832.27K Points
Coach

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

  • (A) ActionEvent
  • (B) ComponentEvent
  • (C) AdjustmentEvent
  • (D) WindowEvent

A

Admin • 832.27K Points
Coach

Q. Which of these methods in KeyEvent class can be used to know which key is pressed?

  • (A) getKeyCode()
  • (B) getModifier()
  • (C) getActionKey()
  • (D) getActionEvent()

A

Admin • 832.27K Points
Coach

Q. The default layout manager of an Applet is

  • (A) Flowlayout
  • (B) Gridlayout
  • (C) BorderLayout
  • (D) BoxLayout

A

Admin • 832.27K Points
Coach

Q. The processes that participate in supporting remote method invocation are

  • (A) Client
  • (B) Server
  • (C) Object Registry
  • (D) All of the above

A

Admin • 832.27K Points
Coach

Q. Swing is a ___________ framework

  • (A) connection-based
  • (B) component-based
  • (C) platform-based
  • (D) None of the above

A

Admin • 832.27K Points
Coach

Q. How many kinds of classes can be used in Java RMI?

  • (A) 1
  • (B) 2
  • (C) 3
  • (D) 4

A

Admin • 832.27K Points
Coach

Q. Which method is used to enable an event for a particular object?

  • (A) enableEvent()
  • (B) enable()
  • (C) enableObject()
  • (D) enableEvents()

A

Admin • 832.27K Points
Coach

Q. How would you detect a keypress in a JComboBox?

  • (A) Add a KeyListener to the JComboBox
  • (B) Add a KeyListener to the JComboBox’s editor component
  • (C) Either (a) or (b)
  • (D) None of the above

A

Admin • 832.27K Points
Coach

Q. Which Swing methods are thread-safe?

  • (A) repaint()
  • (B) revalidate()
  • (C) invalidate()
  • (D) all of the above

Add MCQ in this Category

If you want to share an MCQ question in this category, it's a great idea! It will be helpful for many other students using this website.

Share Your MCQ