Skip to content
Sharp

Java Threading · interview question

Why is it important to use synchronization when accessing shared mutable data across multiple threads?

Multiple choiceEasychapter-15-curatedpremiumjava-threadingrace-conditions
Choose one answer
Answer and explanation

Correct answer

B. To prevent data inconsistency.

Why

Synchronization ensures that only one thread can access the shared data at a time, preventing data corruption and ensuring that operations on shared data are performed atomically.

Test yourself on Java Threading

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

Start free test
All Java Threading questions →