This week's book giveaway is in the Agile and other Processes forum.
We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line!
See this thread for details.
The moose likes Threads and Synchronization and the fly likes Wait method and sleep method Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Threads and Synchronization
Reply Bookmark "Wait method and sleep method" Watch "Wait method and sleep method" New topic
Author

Wait method and sleep method

Chathura Ma
Greenhorn

Joined: Feb 20, 2011
Posts: 4
Hi all,

I need to know what is the different between wait method and sleep method.. is the functionality of those 2 methods equivalent ?
Specially wait(100) is one??? there is an overloaded method in wait we can pass a long value

Thanks
prem pillai
Ranch Hand

Joined: Nov 02, 2007
Posts: 87

Before posting a query , just try searching the forum ; Somebody else might had the same query as yours ...and already answered.

Also have a look at javadocs for sleep() and wait()
http://download.oracle.com/javase/6/docs/api/java/lang/Thread.html#sleep(long)
http://download.oracle.com/javase/6/docs/api/java/lang/Object.html#wait()
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Wait method and sleep method
 
Similar Threads
Thread.Sleep
What's the difference between the methods sleep() and wait()
Synchronization
Threads MindQ 41
Thread