Volatile ensures changes to a variable are visible to all threads immediately.
In Java, the 'volatile' keyword ensures that a variable's value is always read from main memory, not from a thread's local cache. This guarantees that when one thread updates a volatile variable, other threads see the updated value right away. For instance, if a volatile boolean 'isSaleOn' is used, when one thread changes its value during a flash sale, all other threads will see the new value immediately.
Additional Notes
How can volatile improve variable visibility in the Java Memory Model?