标签:一个 safe detail public ace mmu title strong can
Integer, Boolean 等 is immutable, you can only change the reference, but you can‘t change the object itself. 固有MutableInteger
class Holder<T> { public T value; }
The choice of these two types should not depend on the performance. The main choice for AtomicInteger
is if
you want to achieve thread safety with the operations on the integer. However the performace difference might
strongly depend on the choosen operating system, as the detailed implementation of atomic operations depend
on the operating system.
Integer VS AtomicInteger VS MutableInteger
标签:一个 safe detail public ace mmu title strong can
原文地址:http://www.cnblogs.com/yuyutianxia/p/7257427.html