> 
> **Possible Duplicate:**  
> 
> [Java Synchronized Block for .class](https://stackoverflow.com/questions/2056243/java-synchronized-block-for-class)
> 
> 
> 

I was reading through an [article](http://javarevisited.blogspot.in/2011/04/synchronization-in-java-synchronized.html) on synchronization. I am confused on below points and need more clarification

1. For synchronization block. How  

```
synchronized (this) {
    // code
}

```

differs from

```
synchronized (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 that method then that means it will acquire lock on the whole class. So does that mean the other two will also get locked and no other method will be able to access those two methods as the whole class is having lock?