October 16, 2010 at 12:14 PM
Synchronization is best use with the Multi-Threading in Java. Synchronization is the way to make our program safe. As we know when we have two or more threads that share a common code there can be some problem like inconsistent of data if one thread is updating data in that code. so if we make that sharable code synchronized then its ensured that at a given time only one thread will be having rights to access that code. other threads can't access the code until its free that is not being used by other thread.