Java Multithreading MCQs with answers Page - 3

You will find multiple-choice questions (MCQs) related to #Java Multithreading here. Go through these questions to prepare effectively for your upcoming exams and interviews.

To view the correct answer for any question, simply click the "Show Answer" button.

Have a question to share? Click on "Add Question" to contribute!

A

Admin • 828.43K Points
Coach

Q. Which of these is not a valid thread state?

  • (A) Running
  • (B) Waiting
  • (C) Sleeping
  • (D) Terminated

A

Admin • 828.43K Points
Coach

Q. Which class in Java provides thread pool functionality?

  • (A) ThreadGroup
  • (B) Executors
  • (C) Runnable
  • (D) Timer

A

Admin • 828.43K Points
Coach

Q. Which thread state indicates that the thread has completed execution?

  • (A) Waiting
  • (B) Blocked
  • (C) Terminated
  • (D) Runnable

A

Admin • 828.43K Points
Coach

Q. Which of the following is true about `synchronized` blocks?

  • (A) They can only be used on static methods
  • (B) They allow multiple threads to execute critical section simultaneously
  • (C) They prevent race conditions
  • (D) They are slower than unsynchronized blocks but offer no benefit

A

Admin • 828.43K Points
Coach

Q. Which of the following can be used to schedule tasks for future execution in a background thread?

  • (A) Thread
  • (B) Timer
  • (C) Runnable
  • (D) Process

A

Admin • 828.43K Points
Coach

Q. What is the result of calling `Thread.currentThread()`?

  • (A) Creates a new thread
  • (B) Stops current thread
  • (C) Returns a reference to the current thread
  • (D) Returns null

A

Admin • 828.43K Points
Coach

Q. Which of the following is used to implement mutual exclusion in Java?

  • (A) volatile
  • (B) final
  • (C) synchronized
  • (D) const

A

Admin • 828.43K Points
Coach

Q. What is the output if two threads call `start()` on the same thread object?

  • (A) It will run twice
  • (B) IllegalThreadStateException is thrown
  • (C) It runs once normally
  • (D) Nothing happens

A

Admin • 828.43K Points
Coach

Q. Which method should you override when implementing the Runnable interface?

  • (A) execute()
  • (B) run()
  • (C) start()
  • (D) launch()

A

Admin • 828.43K Points
Coach

Q. Which method in the Thread class checks whether the current thread has been interrupted?

  • (A) isAlive()
  • (B) isInterrupted()
  • (C) wasInterrupted()
  • (D) hasInterrupted()
What's Tag

As you may know, questions are organized under broad categories. Each category can include various types of questions. For example, the "History" category might contain questions about the Revolt of 1857, Shivaji Maharaj, Ancient History, Buddhism, and more.

To further refine this organization, we've introduced tags, which act as sub-categories to group questions more specifically.

Verified users can add tags to any question. If you have any suggestions regarding this system, we'd love to hear from you. Contact Us

Learn More