Java: A synchronized method in the superclass acquires the same lock as one in the subclass, right?

后端 未结 0 549
情深已故
情深已故 2021-02-12 09:58
class A {
    public synchronized void myOneMethod() {
        // ...
    }
}

class B extends A {
    public synchronized void myOtherMethod() {
        // ...
    }
}
         


        
相关标签:
回答
  • 消灭零回复
提交回复
热议问题