如果我对静态方法进行 class 级锁定并且如果一个线程执行它那么它会阻止其他线程执行相同 class 的其他实例方法吗?

If I make class level lock on static method & if one thread execute it so will it block other thread executing other instance method of same class?

假设我们有一个class,其中我们有一个实例方法和一个静态方法。我们在静态方法中使用 class 级锁同步块,在实例方法中使用对象级锁同步块。因此,假设当一个线程开始执行静态方法并进行 class 级别锁定时,同时另一个线程尝试执行实例方法。那么第二个线程将被阻止执行实例方法吗??

可能 static synchronizednon static synchronized 方法都可以 运行 simultaneouslyconcurrently 因为它们锁定不同的对象。

第二个线程不会阻塞。class级锁&这个class对象级锁,两个锁不同,但是可以互相重入