Google News
logo
Java Multithreading - Interview Questions
What is the purpose of the Synchronized block?
The Synchronized block can be used to perform synchronization on any specific resource of the method. Only one thread at a time can execute on a particular resource, and all other threads which attempt to enter the synchronized block are blocked.
 
* Synchronized block is used to lock an object for any shared resource.
* The scope of the synchronized block is limited to the block on which, it is applied. Its scope is smaller than a method.
Advertisement