Question: what is the difference between wait and sleep in java?
Answer: The major difference is that wait() releases the lock or monitor while sleep() doesn't releases any lock or monitor while waiting. Wait is used for inter-thread communication while sleep is used to introduce pause on execution, generally.