What is the difference between a synchronized method and a synchronized block ?
What is the difference between a synchronized method and a synchronized block ?
Answer
In Java programming, each object has a lock. A thread can acquire the lock for an object by using the synchronized keyword. The synchronized keyword can be applied in a method level (coarse grained lock) or block level of code (fine grained lock).
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