AtomicInteger uses CAS to ensure thread-safe updates.
AtomicInteger provides thread-safe operations using Compare-And-Swap (CAS). CAS checks the current value and updates it only if no other thread has modified it. This avoids locking and allows multiple threads to update a counter efficiently. For example, in a flash sale, when multiple threads try to increment a `AtomicInteger` count of sold items, each thread atomically checks and updates the count without waiting for others.