Google News
logo
Java Multithreading - Interview Questions
Why wait(), notify() And notifyAll() methods are in Object Class?
Thread waits for lock associated with the object and notify other threads which are waiting for same lock.
 
If wait(), notify() and notifyAll() will be in thread class, then each thread has to be aware of status of another thread and that does not make sense as each thread runs independent of other thread and has no specific knowledge about other thread.
Advertisement