“Parent class”指父类(也叫基类/超类):在面向对象编程中,被其他类(子类)继承其属性和方法的类。也常用 superclass / base class 表达相近概念。(在不同语言/语境中用词略有差异)
/ˈperənt klæs/
A child class can inherit methods from its parent class.
子类可以从父类继承方法。
If the parent class changes its interface, all subclasses may need to be updated to avoid breaking polymorphic behavior.
如果父类更改了接口,所有子类可能都需要更新,以避免破坏多态行为。
“Parent”原意是“父母/家长”,引申为“来源、上一级”;“class”在编程语境中指“类”。合在一起用亲属关系做比喻:父类提供“家族基础”,子类在其之上扩展或重写。这一比喻在面向对象术语中非常常见。