Skip to content
Sharp

Concurrency basics · interview question

Which statement about the volatile keyword is true?

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

Correct answer

D. Volatile variables ensure visibility across threads

Why

Volatile ensures that any read of a volatile variable will always see the most recent write by any thread, thus guaranteeing visibility across threads.

Test yourself on Concurrency basics

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

Start free test
All Concurrency basics questions →