Skip to content
Sharp

Concurrency basics · interview question

Which of the following is NOT a property of a 'volatile' variable?

Multiple choiceEasychapter-15-curatedpremiumconcurrencythe-volatile-keyword
Choose one answer
Answer and explanation

Correct answer

A. Ensures atomicity of compound actions

Why

Volatile variables guarantee visibility but do not ensure atomicity for compound actions like increments or updates.

Test yourself on Concurrency basics

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

Start free test
All Concurrency basics questions →