Problem Statement
What does 'volatile' guarantee in Java?
Explanation
volatile publishes the latest value to all threads and prevents certain re-orderings. It does not make compound updates atomic; use locks or atomics for that.
Practice Sets
This question appears in the following practice sets:
