Assume the following method is properly synchronized and called from a thread A on an object B: wait(2000); After calling this method, when will the thread A become a candidate to get another turn at the CPU?

Review the verified answer and explanation for this DemoPaper-Pakistan past-paper question on CampusFin.

Assume the following method is properly synchronized and called from a thread A on an object B: wait(2000); After calling this method, when will the thread A become a candidate to get another turn at the CPU? Answer: After thread A is notified, or after two seconds.

Option A. Either of the two events (notification or wait time expiration) will make the thread become a candidate for running again. Option B is incorrect because a waiting thread will not return to runnable when the lock is released, unless a notification occurs. Option C is incorrect because the thread will become a candidate immediately after notification, not two seconds afterwards. Option D is also incorrect because a thread will not come out of a waiting pool just because a lock has been released.

Question context

This question is part of ☕ Java Programming within the broader 💻 Programming subject and appears in the DemoPaper-Pakistan preparation collection. Reviewing the answer together with nearby questions helps reinforce the underlying concept and identify how it may appear in competitive exams.