A)
->if the static method is synchronized, this is not allowed in static method.
Synchronized (Account.class)
{
---
---
}
->If static method Synchronized - class locked.
->if instance method synchronized- object locking.
Q) Example program on method level and block level Synchronized
A)
->mostly used in block level synchronization, because non-synchronization methods are brought to synchronize for execution.
Comments
Post a Comment