c++继承类型_C ++中的继承类型

c++继承类型

In C++, we have 5 different types of Inheritance. Namely,

在C ++中,我们有5种不同类型的继承。 即

  1. Single Inheritance

    单继承

  2. Multiple Inheritance

    多重继承

  3. Hierarchical Inheritance

    层次继承

  4. Multilevel Inheritance

    多级继承

  5. Hybrid Inheritance (also known as Virtual Inheritance)

    混合继承(也称为虚拟继承)

C ++中的单一继承 (Single Inheritance in C++)

In this type of inheritance one derived class inherits from only one base class. It is the most simplest form of Inheritance.

在这种继承类型中,一个派生类仅从一个基类继承。 它是最简单的继承形式。

Single Inheritance in C++

C ++中的多重继承 (Multiple Inheritance in C++)

In this type of inheritance a single derived class may inherit from two or more than two base classes.

在这种继承类型中,单个派生类可以从两个或两个以上的基类继承。

Multiple Inheritance in C++

C ++中的层次继承 (Hierarchical Inheritance in C++)

In this type of inheritance, multiple derived classes inherits from a single base class.

在这种继承类型中,多个派生类从单个基类继承。

Hierarchical Inheritance in C++

C ++中的多级继承 (Multilevel Inheritance in C++)

In this type of inheritance the derived class inherits from a class, which in turn inherits from some other class. The Super class for one, is sub class for the other.

在这种继承类型中,派生类从一个类继承,而该类又从其他某个类继承。 一个的超级类,另一个的子类。

Multilevel Inheritance in C++

C ++中的混合(虚拟)继承 (Hybrid (Virtual) Inheritance in C++)

Hybrid Inheritance is combination of Hierarchical and Mutilevel Inheritance.

混合继承是分层继承和多级继承的组合。

Hybrid Inheritance in C++

翻译自: https://www.studytonight.com/cpp/types-of-inheritance.php

c++继承类型

  • 0
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值