Compound operations are not atomic, meaning they can be interrupted, leading to incorrect results.
The operation count++ is a shorthand for reading, modifying, and writing a value. In a multithreaded context, another thread could alter the variable between these steps, causing data corruption. Use AtomicInteger for thread-safe increment operations.