Multiple choice technology programming languages

Thread Synchronization protects access to _____.

  1. Code

  2. Data

  3. Both

  4. None of these

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

Thread synchronization in Java protects access to shared data by controlling which threads can enter critical sections (code blocks accessing shared data). While the synchronized keyword guards code blocks, the ultimate purpose is protecting shared data from concurrent modification. Option A is somewhat narrow but acceptable as synchronization controls code entry.