程序人生

Java static和final的巧妙应用

static long counter 跟踪所创建的shared的实例的数量,还可以为id提供数值.counter的类型是long而不是int,这样可以防止溢出....