🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← Quiz: Java Multithreading: all 10 questions

Quiz: Java Multithreading · Question 7 of 10

Which of these releases the lock the thread is holding while it waits?

Which of these releases the lock the thread is holding while it waits?

  1. A.Thread.sleep()
  2. B.join() always releases every lock
  3. C.wait()
  4. D.yield()
Answer & explanation

Correct answer: wait()

wait() releases the object's lock until notify() or notifyAll(); sleep() keeps any locks it holds.

Can you get the rest right without peeking?

Take the timed Quiz: Java Multithreading quiz free. Pass it to earn XP and count towards your certificate.

Start the quiz →