[英]Is the derived class an instance of the base class?
When we create a new derived class is it considered as an instance of the base class? 创建新的派生类时,是否将其视为基类的实例? the derived class will have all the functions and attribute that any instance of the base class have. 派生类将具有基类任何实例具有的所有功能和属性。
The derived class is usually called a subclass of the base class(es). 派生类通常称为基类的子类。
Instances of the derived class are also instances of the base class(es). 派生类的实例也是基类的实例。
The derived class is not an instance of the base class, but it is an instance of the base class metaclass , unless the derived class overrides the metaclass. 派生类不是基类的实例,但它是基类元类的实例 ,除非派生类重写元类。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.