标签:nihao value 默认 highlight src cal ges system --
private static ThreadLocal tl = new ThreadLocal(); public static void main(String[] args) { tl.set("nihao");//容器:Map容器--》[key:当前线程对象,value:nihao] Object o = tl.get();//默认的key是当前线程 System.out.println(o);//nihao tl.remove();//默认的key是当前线程 o = tl.get(); System.out.println(o); }
标签:nihao value 默认 highlight src cal ges system --
原文地址:http://www.cnblogs.com/ganchuanpu/p/6158402.html