@Test
public void fun1() {
ThreadLocal<String> t1 = new ThreadLocal<String>();
t1.set("hello"); //存
String s = t1.get(); //取
System.out.println(t1.get());
t1.remove();//删除
System.out.println(t1.get());
System.out.println(s);
}它内部是一个Map , 以当前线程做键!
ThreadLocal 用在哪里?