Home » Unlabelled » Why are there separate wait and sleep methods? | Java Threads
Tuesday, 14 February 2012
Why are there separate wait and sleep methods? | Java Threads
The static Thread.sleep(long) method maintains control of thread execution but delays the next action until the sleep time expires. The wait method gives up control over thread execution indefinitely so that other threads can run.
No comments:
Post a Comment