简单问题一个:
1.这段代码什么意思?
2.有什么特性?
3.这样的代码真正的意义是什么?
public class Test {
private static int index = 0;
private static ThreadLocal t = new ThreadLocal() {
protected synchronized Object initialValue() {
return new Integer(index++); }
};
public static int get() {
return ((Integer) (t.get())).intValue();
}
}