In simple terms, the reasons are as follows.
Object has monitors.
- Multiple threads can access one
Object. Only one thread can hold object monitor at a time for synchronized methods/blocks.
wait(), notify() and notifyAll() method being in Object class allows all the threads created on that object to communicate with other
- Locking ( using
synchronized or Lock API) and Communication (wait() and notify()) are two different concepts.
If Thread class contains wait(), notify() and notifyAll() methods, then it will create below problems:
Thread communication problem
Synchronization on object won’t be possible. If each thread will have monitor, we won’t have any way of achieving synchronization
Inconsistency in state of object
Refer to this article for more details.