1.

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

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



Discussion

No Comment Found