multithreading

wait() vs sleep()?

Featurewait()sleep()
ClassObjectThread
Lock HandlingReleases the lockKeeps the lock
ContextMust be called from synchronized blockCan be called from anywhere
Waking upNeeds notify() or notifyAll()Wakes up after time expires
wait() vs sleep()? | DevExCode