The locks in Java can be divided into object locks, Fang, and class locks by hierarchical points.
Java object locks and class Locks: Java's object locks and class locks are basically the same as the built-in locks in terms of lock concepts, but
Two locks are actually a big difference, object locks are used for object instance methods, or for an object instance, class
A lock is a static method for a class, or a class object on a type. We know that object instances of classes can have a very
multiple, but each class has only one class object, so object locks for different object instances are not interfering with each other, but
There is only one class lock per class. But one thing to note is that the class lock is actually just a conceptual thing, and
is not real, it's just to help us understand the difference between a locked instance method and a static method.
Levels of locks in Java