c# - 什么是阅读 ISomething : ISomethingElse 的正确方法

标签 c# oop inheritance interface

<分区>

如果这是一个非常愚蠢的问题,请原谅我,但我正在寻找有关如何将以下内容解释为简单英语的说明(假设 ISomethingElse 是现有接口(interface)):

public interface ISomething : ISomethingElse {
}

我会这样读吗:

“公共(public)接口(interface) ISomething INHERITS 接口(interface) ISomethingElse”

“公共(public)接口(interface) ISomething 实现 接口(interface) ISomethingElse”

我倾向于“继承”,因为我一直将接口(interface)理解为某种事物的“契约”,而不是“实现”,但我不确定什么是正确的方法。

我主要关注 C#(如果这有影响的话)。

最佳答案

C# 5.0 规范使用“继承”。来自 §13,“接口(interface)”:

An interface defines a contract. A class or struct that implements an interface must adhere to its contract. An interface may inherit from multiple base interfaces, and a class or struct may implement multiple interfaces.

(强调已添加。)

关于c# - 什么是阅读 ISomething : ISomethingElse 的正确方法,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37472614/

相关文章:

java - Java 中的通配符不适用于 Spark cogroup 函数

java - 如何使父类(super class)中的某些方法在子类中不可用

PHP 面向对象 : Unique method per argument type?

php - OOP:您将如何在 OOP 中建立艺术家、专辑和歌曲关系

java - J面板API : Inheritance

c# - 当我只想在某些时候使用别名时,有没有办法避免多余的 "using"指令?

c# - WCF 具有重复方法名称的多个契约(Contract)

C# 同步进行异步调用

c# - 如何将 native 应用程序与 Eclipse 集成?

oop - Perl 6 多方法从不匹配预期的签名