← 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?
- A.Thread.sleep()
- B.join() always releases every lock
- C.wait()
- 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 →