synchronize(this) vs synchronize(MyClass.class) [duplicate]
Possible Duplicate: Java Synchronized Block for .class I was reading through an article on synchronization. I am confused on below points and need more clarification 1) For synchronization block. How synchronize(this){ // code } differs from synchronize(MyClass.class){ //code } 2) Synchronizing instance method means threads will have to get exclusive lock on the instance, while synchronizing static method means thread will have to acquire a lock on whole class(correct me if I am wrong). So if a class has three methods and one of them is static synchronized then if a thread acquires lock on