I\'m looking at some code in a third party library that contains a synchronized method, and within this method there is a synchronized block that locks on an instance variab
I will give a real life example to explain what Andy explained through code(to those who are finding it difficult to understand this):
Suppose You have a 1 BHK Flat .
In this case if someone enters into room from back door and applies lock from inside. One can only enter into the hall and cant enter into the room until the person inside the room releases the lock .
Hope this clarifies to the people who are finding it difficult to understand this.