Skip to content
Sharp

Java Threading · interview question

What does volatile actually guarantee in Java?

Multiple choiceEasychapter-15-curatedpremiumjava-threadingvolatile-keyword
Choose one answer
Answer and explanation

Correct answer

D. Visibility of the latest write across threads, but not atomic compound actions

Why

volatile ensures threads observe the latest value, but it does not make multi-step operations like read-modify-write atomic. You still need stronger coordination for compound invariants.

Test yourself on Java Threading

A free test with instant, explained results. No account needed.

Start free test
All Java Threading questions →