Question: what is the difference between wait and sleep notify and notifyall methods?
Answer: Java sleep() and wait() – Discussion But in case of wait() method, thread goes in waiting state and it won't come back automatically until we call the notify() or notifyAll() . The major difference is that wait() releases the lock or monitor while sleep() doesn't releases the lock or monitor while waiting.