0 votes
in JAVA by
The difference between sleep and wait in Java?

1 Answer

0 votes
by

Though both are used to pause currently running thread, sleep() is actually meant for short pause because it doesn't release lock, while wait() is meant for conditional wait and that's why it release lock which can then be acquired by another thread to change the condition on which it is waiting.

Related questions

+1 vote
asked Apr 15, 2021 in JAVA by SakshiSharma
0 votes
asked Oct 12, 2020 in JAVA by Robindeniel
...