Atomic classes live in java.util.concurrent.atomic and they exist for one job: let many threads update a single shared variable correctly, without a lock. They wrap a value (an int, a long, a boolean, a reference, an array slot) and expose operations that the JVM compiles down to a single hardware instruction. That instruction is what makes the update safe under contention. This lesson covers the main classes (AtomicInteger, AtomicLong, AtomicBoolean, AtomicReference, AtomicIntegerArray), the compare-and-swap (CAS) operation that powers them, the higher-level helpers (updateAndGet, accumulateAndGet), the high-contention specialists (LongAdder, LongAccumulator), and the ABA problem with its fix (AtomicStampedReference).
Here, the focus is on the lock-free, single-variable case where atomics are well-suited.