title: How to put a particular thread to sleep()?
body: <p>I was reading sleep() method of Threads. I tried to develop a small example. I have two 
  confusions regarding this example.</p>
  
  <pre><code>/**
   * Created with IntelliJ IDEA.
   * User: Ben
   * Date: 8/7/13
   * Time: 2:48 PM
   * To change this template use File | Settings | File Templates.
   */
  
  class SleepRunnable implements Runnable{
  
    public void run() {
      for(int i =0 ; i &lt; 100 ; i++){
        System.out.println("Running: " + Thread.currentThread().getName());
      }
      try {
        Thread.sleep(500);
      }
      catch(InterruptedException e) {
        System.out.println(Thread.currentThread().getName() +" I have been interrupted");
      }
    }
  }
  
  public class ThreadSleepTest {
    public static void main(String[] args){
      Runnable runnable = new SleepRunnable();
      Thread t1 = new Thread(runnable);
      Thread t2 = new Thread(runnable);
      Thread t3 = new Thread(runnable);
      t1.setName("Ben");
      t2.setName("Rish");
      t3.setName("Mom");
      t1.start();
      t2.start();
      t3.start();
    }
  }
  </code></pre>
  
  <ol>
  <li>As i discussed in my last posts, interrupted exception will occur if a thread wakes up after a specified amount of time and it will simply return from the run method. In this example of mine, the code never enters the catch() block. Why is it so?</li>
  <li>Now, all of the threads in the above example will sleep for a second and will take turns gracefully, what if i specifically wanted to make the thread "Ben" sleep. I don't think so  it is possible in this example.</li>
  </ol>
  
  <p>Can someone elaborate on this concept a little further.</p>