简体   繁体   中英

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM