What is difference between wait() and sleep() method?
Page 1 of 1
What is difference between wait() and sleep() method?
wait()
1) The wait() method is defined in Object class.
2) wait() method releases the lock.
sleep()
The sleep() method is defined in Thread class.
The sleep() method doesn't releases the lock.
1) The wait() method is defined in Object class.
2) wait() method releases the lock.
sleep()
The sleep() method is defined in Thread class.
The sleep() method doesn't releases the lock.
Similar topics
» Can subclass overriding method declare an exception if parent class method doesn't throw an exception ?
» What is a native method?
» What does join() method?
» What does the hashCode() method?
» What is the purpose of finalize() method?
» What is a native method?
» What does join() method?
» What does the hashCode() method?
» What is the purpose of finalize() method?
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum
|
|