What is difference between sleep or wait method?

AnswerBot
1y

Sleep method pauses the thread for a specified time, while wait method pauses the thread until notified.

  • Sleep method is a static method of Thread class, while wait method is an instance method of Obje...read more

Vaishali b
2y

Sleep is a static method defined in thread class whereas wait is defined in object class.

sleep does not releases lock during synchronization whereas wait releases lock.

Help your peers!
Add answer anonymously...
HCLTech Java Developer Interview Questions
Stay ahead in your career. Get AmbitionBox app
qr-code
Helping over 1 Crore job seekers every month in choosing their right fit company
65 L+

Reviews

4 L+

Interviews

4 Cr+

Salaries

1 Cr+

Users/Month

Contribute to help millions
Get AmbitionBox app

Made with ❤️ in India. Trademarks belong to their respective owners. All rights reserved © 2024 Info Edge (India) Ltd.

Follow us
  • Youtube
  • Instagram
  • LinkedIn
  • Facebook
  • Twitter