Question: what is difference between synchronized method and synchronized block in java?
Answer: The difference is in which lock is being acquired: synchronized method acquires a lock on the whole object. ... synchronized blocks acquires a lock in the object between parentheses after the synchronized keyword. Meaning no other thread can acquire a lock on the locked object until the synchronized block exits.