What is the reason for wait() & notify() methods defined in the Object class? Why they are not defined in the Thread class?

Questions by kk_om10

Showing Answers 1 - 1 of 1 Answers

syedashazama

  • Mar 14th, 2007
 

The most simple and obvious reason is that any Object (not just a thread) can be the monitor for a thread. The wait and notify are called on the monitor. The running thread checks with the monitor.

So the wait and notify methods are in Object and not Thread.

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions