c#.net中的多重继承 - 抽象类 [英] multiple inheritance in c#.net - abstract classes

查看:242
本文介绍了c#.net中的多重继承 - 抽象类的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

快速提问。



浏览继承文章



我明白不支持多重继承在c#.net中。但您仍然可以通过实现多个接口来实现该功能。现在我的问题是,只要它们是抽象的,子类可以继承两个或更多类吗?有可能吗?



继承支持哪种耦合?

Quick question.

Going through inheritance articles

I understand that multiple inheritance is not supported in c#.net. But you can still achieve the functionality by implementing multiple interfaces. Now my question is Can a child class inherit from two or more classes as long as they are abstract? Is it possible ?

What coupling does inheritance support?

推荐答案

否。

类可以从一个和Oulu继承一个基类,无论是抽象的还是具体的。您可以根据需要添加任意数量的接口,但是一个类是绝对限制。在使用接口之外,C#不支持任何形式的多重继承。
No.
A class can inherit from one and Oulu one base class, whether abstract or concrete. You can add as many Interfaces as you want, but one class is the absolute limit. C# does not support multiple inheritance in any form, outside the use of interfaces.


这篇关于c#.net中的多重继承 - 抽象类的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆