How do you prevent shared data from being corrupted in a multithreaded environment?
D.
Variables may not be synchronized.
Making the variables volatile or static doesn't address the problem.
Shared data in a multithreaded environment should be protected by ensuring that all access to the data is via synchronized methods.
All methods should synchronize on the same lock.