Using a Thread-Local Variable : ThreadLocal « Thread « Java Tutorial






public class Main {
  public static void main(String[] argv) throws Exception {
    ThreadLocal localThread = new ThreadLocal();
    Object o = localThread.get();
    localThread.set(o);

  }
}








10.20.ThreadLocal
10.20.1.Using a Thread-Local Variable