xxxxxxxxxx
synchronized(monitor)
{
Thread.sleep(1000); Here Lock Is Held By The Current Thread
//after 1000 milliseconds, current thread will wake up, or after we call that is interrupt() method
}
xxxxxxxxxx
What is sleep() method:
The sleep() method is a static method of Thread class and it makes the
thread sleep/stop working for a specific amount of time.
The sleep() method throws an InterruptedException if a thread is
interrupted by other threads,that means Thread.