O'Reilly logo
  • Dong Yu thinks this is interesting:

As we mentioned, a class lock does not actually exist. The class lock is the object lock of the Class object that models the class. Since there is only one Class object per class, using this object achieves the synchronization for static methods. For the developer, it is best envisioned as follows. Only one thread can execute a synchronized static method per class. Only one thread per instance of the class can execute a nonstatic synchronized method.


Cover of Java Threads, 3rd Edition


class lock and object lock