Let's see a sample code
This is a synchronized method. That means that only one
thread at the time can execute the code of the method. To gain access to the method, the thread must obtain a lock on the object. So the code would be very similar to this:
Now, you could use another object, different from this, to obtain a lock (that's to say, the right to execute the code withing the synchronized block.
It has the another adventage: you can control better the scope of the synchronization and therefore possibly optimizing performance.