What is the difference between a wait() and sleep() in Threads?
wait()
sleep()
Is my understanding that a wait()-ing Thread is still in runni
wait releases the lock and sleep doesn't. A thread in waiting state is eligible for waking up as soon as notify or notifyAll is called. But in case of sleep the thread keeps the lock and it'll only be eligible once the sleep time is over.
wait
sleep
notify
notifyAll