Medium-HardJava CoreMultiple Choice

What is the purpose of the volatile keyword in Java?

Tests your understanding of this concept.

Answer Options

AMakes a variable immutable
BEnsures visibility across threads — reads always see the latest write
CPrevents garbage collection
DLocks the variable for exclusive access

Want to see the correct answer?

Get the answer with a detailed explanation, plus practice 20+ more Java Core questions with adaptive quizzes and timed interviews.

See the Answer on Guru Sishya →

This question is from the Java Core topic (Programming Languages).

More Java Core Questions