What is the difference between a synchronized method and a synchronized block ?

1 year ago
OOP Java

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).

More related questions

Questions Bank

View all Questions

Top