is synchronized by class name in a function will be valid across extended classes?

后端 未结 3 1480
执笔经年
执笔经年 2021-01-22 02:30

I have a methode foo in base class uses Synchronized (class name) , and two classes A and B that extends the base class. if i called foo from A instance and B instance in two di

3条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2021-01-22 03:05

    Yes. It is synchronized, even though sequence of thread execution is not guaranteed.

提交回复
热议问题