🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← All topics

Quiz: Java Multithreading: questions with answers

10 questions, each with the answer and a short explanation.

Take the timed quiz + get a certificate →
  1. Q1. Which method starts a new thread of execution?
  2. Q2. What do all threads of a process share?
  3. Q3. Why can count++ give wrong results with two threads?
  4. Q4. What does join() do?
  5. Q5. Which is a thread-safe Map for heavy concurrent use?
  6. Q6. What does this print? (code)
  7. Q7. Which of these releases the lock the thread is holding while it waits?
  8. Q8. What does marking a field volatile guarantee?
  9. Q9. Which rule prevents the classic two-lock deadlock?
  10. Q10. What does this print? (code)