Home > DeveloperSection > Interviews > What is difference between wait() and sleep() method?

Posted on    May-07-2015 1:03 AM

 Java Java  Thread 
Ratings:
 1 Answer(s)
  414  View(s)
Rate this:

Mayank Tripathi
Mayank Tripathi

Total Post:807

Points:4035
Posted on    May-07-2015 1:03 AM

wait()
1) The wait() method is defined in Object class.
2) wait() method releases the lock.

sleep()
1)The sleep() method is defined in Thread class.
2)The sleep() method doesn't releases the lock.

Don't want to miss updates? Please click the below button!

Follow MindStick