Digital Marketing

Difference between sleep() and wait() in Java?

Java sleep () and wait ()

The major difference is that wait () releases the lock or monitor while sleep () doesn't releases the lock or monitor while waiting. wait () is used for inter-thread communication while sleep () is used to introduce pause on execution, generally.

Comments

Popular posts from this blog

MySQL Sandbox with the Sakila sample database