Java Multithreading MCQs with answers Page - 6

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 method is called internally by `start()`?

  • (A) run()
  • (B) begin()
  • (C) initialize()
  • (D) execute()

A

Admin • 828.43K Points
Coach

Q. Which class provides a framework for asynchronous task execution?

  • (A) ExecutorService
  • (B) Runnable
  • (C) Callable
  • (D) Semaphore

A

Admin • 828.43K Points
Coach

Q. Which thread method would you use to run a thread in the background?

  • (A) start()
  • (B) run()
  • (C) setDaemon(true)
  • (D) yield()

A

Admin • 828.43K Points
Coach

Q. Which method stops accepting new tasks in ExecutorService?

  • (A) stop()
  • (B) shutdown()
  • (C) cancel()
  • (D) exit()

A

Admin • 828.43K Points
Coach

Q. Which interface allows scheduling of tasks with a delay?

  • (A) Runnable
  • (B) Callable
  • (C) ScheduledExecutorService
  • (D) TimerTask

A

Admin • 828.43K Points
Coach

Q. How many times can a thread object's `start()` method be called?

  • (A) Once
  • (B) Twice
  • (C) Unlimited times
  • (D) Depends on JVM

A

Admin • 828.43K Points
Coach

Q. Which of the following can be used to limit access to a resource to only one thread at a time?

  • (A) Thread
  • (B) Semaphore
  • (C) synchronized
  • (D) volatile

A

Admin • 828.43K Points
Coach

Q. Which of the following best describes a thread-safe class?

  • (A) A class that only one thread can use
  • (B) A class that uses exceptions to handle threads
  • (C) A class that ensures consistent behavior when used by multiple threads
  • (D) A class that uses ThreadLocal only
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