This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes Thread.sleep(milisec) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Thread.sleep(milisec)" Watch "Thread.sleep(milisec)" New topic


kalps ganvir

Joined: Mar 29, 2006
Posts: 8
i know that sleep method coz current thread to suspend its execution
for milisec ok!! but my question is about the exception thrown by this method is InterrupedException when will this excetion is thrown by

Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 14074

InterruptedException is thrown from Thread.sleep() when another thread calls interrupt() on the sleeping thread.

Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 7 API documentation
Scala Notes - My blog about Scala
kalps ganvir

Joined: Mar 29, 2006
Posts: 8
thnks but not satisfied
I agree. Here's the link:
subject: Thread.sleep(milisec)
Similar Threads
one more question from Dan's questions
Threads and Exceptions
wait in idle mode?
Sleepy Threads