以下代码只在运行结束后打印结果
运行了5次结果
499980
499984
499982
499973
499989
而如果用AtomicInteger
运行5次结果
500000
500000
500000
500000
还是500000
懂了吧
以下代码只在运行结束后打印结果
运行了5次结果
499980
499984
499982
499973
499989
而如果用AtomicInteger
运行5次结果
500000
500000
500000
500000
还是500000
懂了吧