0
What is "Atomic integer" in java?
private static final AtomicInteger i = new AtomicInteger(1);
1 ответ
+ 1
It allows you to use Atomic operations.
If you have multi threading application than simple increment like i++ may end with wrong result. That's why it's better to use atomic operations.