---
title: "Point out difference between  sleep() and wait() method in java"  
description: "Point out difference between  sleep() and wait() method in java"  
author: "Anonymous User"  
published: 2015-09-10  
updated: 2020-09-23  
canonical: https://www.mindstick.com/interview/22818/point-out-difference-between-sleep-and-wait-method-in-java  
category: "java"  
tags: ["java", "thread", "threading", "multiple threading"]  
reading_time: 1 minute  

---

# Point out difference between  sleep() and wait() method in java

The code sleep(1000); puts thread aside for exactly one second. The code wait(1000), causes a wait of up to one second. A thread could stop waiting earlier if it receives the notify() or notifyAll() call. The method wait() is defined in the class Object and the method sleep() is defined in the class Thread.

## Answers

### Answer by Anonymous User

The code sleep(1000); puts thread aside for exactly one second. The code wait(1000), causes a wait of up to one second. A thread could stop waiting earlier if it receives the notify() or notifyAll() call. The method wait() is defined in the class Object and the method sleep() is defined in the class Thread.


---

Original Source: https://www.mindstick.com/interview/22818/point-out-difference-between-sleep-and-wait-method-in-java

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
