It's said in K&B ' s book:
When you synchronize a method, the object used to invoke the method is the object whose lock must be acquired. But when you synchronize a block of code, you specify which object's lock you want to use the lock, so you could, for example, use some third - party object as the lock for this piece of code.
Please explain this. Thanks in Advanced!