接口是否在继承链中? [英] Is Interface comes in inheritance chain or not?

查看:51
本文介绍了接口是否在继承链中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Internet上有两种关于Interface的陈述,即
声明A

There are two type of statements on internet about Interface, that is
Statement A

接口不属于继承链.

Interfaces do not come in inheriting chain.

其他声明B

接口可以继承其他接口

这两个矛盾的陈述.

请告诉我哪个是对的?

推荐答案

它们都是正确的.

声明A:接口不严格继承.如果您有一个实现接口的类,并且您说

Statement A: Interfaces don't strictly inherit. If you have a class that implements an interface, and you say

base.

您将看不到该界面的成员.

You won't see members of the interface.

声明B:读起来更好,因为接口可以实现其他接口".您可以拥有一个实施链;但它们并不是真正的继承人.

Statement B: This would read better as "Interfaces can implement other interfaces". You can have an implementation chain; but they're not really inheriting.

这篇关于接口是否在继承链中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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