title: interrupt() not working as expected (how does interrupt work?)
body: <p>I want to interrupt a thread, but invoking <code>interrupt()</code> doesn't seem to work. Below is the sample code:</p>
  
  <pre><code>public class BasicThreadrRunner {
      public static void main(String[] args) {
          Thread t1 = new Thread(new Basic(), "thread1");
          t1.start();
          Thread t3 = new Thread(new Basic(), "thread3");
          Thread t4 = new Thread(new Basic(), "thread4");
          t3.start();
          t1.interrupt();
          t4.start();
      }
  }
  class Basic implements Runnable{
      public void run(){
          while(true) {
              System.out.println(Thread.currentThread().getName());
              try {
                  Thread.sleep(1000);
              } catch (InterruptedException e) {
                  System.err.println("thread: " + Thread.currentThread().getName());
                  //e.printStackTrace();
              }
          }
      }
  }
  </code></pre>
  
  <p>but the output looks like thread 1 is still running. Can anyone explain this as well as how <code>interrupt()</code> works? Thanks!</p>