title: Memory allocation with Thread
body: <p>I am wondering what happen if you declare a local thread within a method? Normally all the local variables will be gone as soon as the function returns since they are all allocated on Stack.  However, it seems that a local thread would be a different story. Is that right? </p>
  
  <pre><code>public int A() {
      Thread t = new Thread() {
          doSomething();
      }
      t.start();
      return -1;
   }
  </code></pre>