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.
Disclimer: PCDS.CO.IN not responsible for any content, information, data or any feature of website.
If you are using this website then its your own responsibility to understand the content of the website