title: Java Thread.stop() vs Thread.interrupt()
body: <p>I have the following code:</p>
  
  <pre><code>renderThread = new Thread(new Runnable() {
  
      @Override
      public void run() {
          for (int i = 0; i &lt; 10000000; i++) {
              System.out.println("Number: " + i);
          }
      }
  });
  
  renderThread.start();
  
  try {
      Thread.sleep(100);
  } catch (InterruptedException ex) {
      ex.printStackTrace();
  }
  
  renderThread.interrupt(); //It should stop, but it does not stop.
  </code></pre>
  
  <p><code>renderThread.interrupt()</code> does not interrupt the thread, it continues to run. If I replace <code>renderThread.interrupt()</code> with <code>.stop()</code>, then the thread stops. However, <code>.stop()</code> is deprecated.
  Then, what is the proper way of stopping a thread, if <code>stop</code> is deprecated and <code>interrupt</code> does not work?</p>