简单ThreadLocal 实例测试类:TestLocal tlnew TestLocal()tl.sayHello()System.out.print(tl.message.g
简单ThreadLocal 实例
测试类:
TestLocal tl=new TestLocal();tl.sayHello();System.out.print(tl.message.get());
?这样就实现了客户端调用一个类中的信息。线程中如何使用还有待研究。
简单ThreadLocal 实例
测试类:
TestLocal tl=new TestLocal();tl.sayHello();System.out.print(tl.message.get());
?这样就实现了客户端调用一个类中的信息。线程中如何使用还有待研究。