Tag: sleep


  • 1. Java sleep() and wait() – Discussion sleep() is a method which is used to pause the process for few seconds or the time we want to. 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…