Pergunta de entrevista da empresa BNP Paribas

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

Resposta da entrevista

Sigiloso

20 de jan. de 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