Java MCQs with answers Page - 17

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 • 831.35K Points
Coach

Q. Which is the super class of all exception classes

  • (A) Exception
  • (B) Object
  • (C) Error
  • (D) Throwable

A

Admin • 831.35K Points
Coach

Q. Which class is the super class of all classes of the java.lang package?

  • (A) Object
  • (B) System
  • (C) Super
  • (D) Class

A

Admin • 831.35K Points
Coach

Q. Which of the following exception is raised when a number is divided by zero

  • (A) NumberFormatException
  • (B) ArithmeticException
  • (C) NullPointerException
  • (D) IllegalArgumentException

A

Admin • 831.35K Points
Coach

Q. A single try block must be followed by which of these?

  • (A) finally
  • (B) catch
  • (C) catch or finally
  • (D) None of the mentioned

A

Admin • 831.35K Points
Coach

Q. Runnable is a

  • (A) Class
  • (B) Method
  • (C) Variable
  • (D) Interface

A

Admin • 831.35K Points
Coach

Q. Thread priority in Java is represented as?

  • (A) int
  • (B) Float
  • (C) double
  • (D) long

A

Admin • 831.35K Points
Coach

Q. Which of these class is used to make a thread?

  • (A) String
  • (B) System
  • (C) Thread
  • (D) Runnable

A

Admin • 831.35K Points
Coach

Q. Which of these interface is implemented to create a Thread?

  • (A) Runnable
  • (B) Connections
  • (C) Set
  • (D) MapConnections

A

Admin • 831.35K Points
Coach

Q. Which of these method of Thread class is used to find out the priority given to a thread?

  • (A) get()
  • (B) ThreadPriority()
  • (C) getPriority()
  • (D) getThreadPriority()

A

Admin • 831.35K Points
Coach

Q. Which of this method of Thread class is used to change the state of a thread to blocked state?

  • (A) sleep()
  • (B) terminate()
  • (C) stop()
  • (D) block()

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