Home  >  Q&A  >  body text

java - synchronized 关键字修饰方法,能不能继承 ?

有哪位朋友能详细的解释下synchronized关键字

天蓬老师天蓬老师2743 days ago646

reply all(1)I'll reply

  • PHP中文网

    PHP中文网2017-04-18 10:56:00

    Inheritance means that a subclass inherits the characteristics and behaviors of the parent class, so that the subclass object (instance) has the instance fields and methods of the parent class, or the subclass inherits methods from the parent class, so that the subclass has the same behavior as the parent class

    The synchronized keyword is used to control thread synchronization, which is to control the synchronized code segment from being executed by multiple threads at the same time in a multi-threaded environment. synchronized can be added to a piece of code or a method.

    These two points are not conflicting

    reply
    0
  • Cancelreply