1.

What Is The Difference Between Wait() And Sleep()?

Answer»
  • WAIT() is a METHOD of Object class. sleep() is a method of Thread class.
  • sleep() allows the thread to go to sleep state for x milliseconds. When a thread goes into sleep state it doesn’t release the LOCK. wait() allows thread to release the lock and goes to suspended state. The thread is only ACTIVE when a notify() or notifAll() method is called for the same object.



Discussion

No Comment Found