Causes a thread which is waiting on this object's monitor (by means of calling one of the wait() methods) to be woken up. If more than one thread is waiting, one of them is chosen at the discretion of the VM. The chosen thread will not run immediately. The thread that called notify() has to release the object's monitor first. Also, the chosen thread still has to compete against other threads that try to synchronize on the same object.
This method can only be invoked by a thread which owns this object's monitor. A thread becomes owner of an object's monitor