What is synchronization?
Synchronization is the capability to control the access of multiple threads to the shared resources. Synchronized keyword in Java provides locking that ensures exclusive mutual access of shared resources and prevents data race.