Domanda di colloquio di BNP Paribas

How the locking will happen if method is declared as static and synchronized?

Risposta di colloquio

Anonimo

20 gen 2012

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

1