What do you call it when one interface “inherits” from another?

后端 未结 6 1159
北荒
北荒 2020-12-02 20:17

If I have class B : A {}

I say that \"Class B inherited class A\" or \"class B derives from class A\".

However, if I instead have:



        
6条回答
  •  情书的邮戳
    2020-12-02 20:52

    I personally say "extends" and I thought the C# spec uses that word as well somewhere (I can't find it now, unfortunately) - but I remember Eric Lippert saying he wasn't keen on it, and wanted to change it for 4.0.

    I think it's good, because it shows that you're extending the contract specified by the original interface.

    EDIT: Having looked at the 3.0 spec...

    The spec sort of side-steps the issue in section 13.2. It talks about the members being inherited from the base interfaces. It talks about one class extending another, but not interfaces

    EDIT: In the C# 5 spec, section 13.1.4, it uses inherits:

    An interface can inherit from zero or more interface types

    So that's probably the best term to use.

提交回复
热议问题