This means that - If a thread T1 has obtained a lock on the object, then another thread T2 cannot access any of "synchronized non-static" methods of the object. But thread T2 can very well access "synchronized static" methods of the object. To restrict access to "synchronized static" methods, the thread T2 must obtain a lock on the "Class" object.
Synchronization means acquiring the lock.There are 2 types of locks in Java : 1) Static Lock or Synchronization 2) Object Lock or Sysnchronization
The above statement means that to acquire the lock of a class is different than acquiring the lock of an object of the class.Locking an object does not automatically protect access to static fields of that object's class or any of its superclasses.
Access to static fields is instead protected via synchronized static methods and blocks. Static synchronization employs the lock possessed by the Class object associated with the class the static methods are declared in.
And i guess locking a Class object also doesn't mean to lock all the objects of the class ? Anyone in the forum, could u plz clarify this.