How the locking will happen if method is declared as static and synchronized?
Anoniem
The lock will happen on class level not on the Object.So there is only one class object per classloader.We can safe that method from multiple thread even thread are using different instanses of object as it is getting lock on class