volatile alone makes count++ atomic.

Practice this question from Quiz: Java Concurrency, with options and an explanation.

Question

volatile alone makes count++ atomic.

Option A

True

volatile helps threads see fresh values but does not make compound actions atomic.

Option B — Correct answer

False

volatile helps threads see fresh values but does not make compound actions atomic.

Quiz: Java Concurrency

All questions · Previous question · Next question

Open on QuizMaker