Java Thread notify() method
The notify() method of thread class is used to wake up a single thread. This method gives the notification for only one thread which is waiting for a particular object.
If we use notify() method and multiple threads are waiting for the notification then only one thread get the notification and the remaining thread have to wait for further notification.
This method does not return any value.
IllegalMonitorStateException: This exception throws if the current thread is not the owner of the object's monitor.
Starting of Thread-1 Starting of Thread-2 Starting of Thread-3 Thread-3...notified Thread-1...notified