Question: Question: What happens when a thread is waiting on an objects monitor using the wait() method, and the objects notify() method is called by another
Question: What happens when a thread is waiting on an object’s monitor using the wait() method, and the object’s notify() method is called by another thread?
A) The waiting thread is immediately resumed and starts running.
B) The waiting thread will be moved to the runnable state but still needs to reacquire the lock before resuming.
C) The notify() method will directly interrupt the waiting thread, causing it to throw an InterruptedException.
D) The waiting thread continues to wait until the notifyAll() method is called.
Step by Step Solution
There are 3 Steps involved in it
The detailed answer for the above question is provided below The correct option is B The waiting thread will be moved to the runnable state but still ... View full answer
Get step-by-step solutions from verified subject matter experts
