← Back to Javawait() vs sleep()
Javajava
The Question
What is the difference between wait() and sleep() in Java?
What a Strong Answer Covers
- wait() in Object releases lock must be in synchronized block
- sleep() in Thread does not release lock
- wait() for inter-thread communication
- sleep() for time delay
- both throw InterruptedException
Related Questions
Practice This Question
Get AI-graded feedback on your answer with follow-up probes on weak points.
Take the Free Assessment