Why is synchronization used in Java multithreading?

Last Updated :
Discuss
Comments

Why is synchronization used in Java multithreading?

To improve CPU performance

To allow multiple threads to execute at once

To prevent data inconsistency and race conditions

To increase thread priority

Share your thoughts in the comments