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

后端 未结 6 1167
北荒
北荒 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:57

    Why would it be wrong to say InterfaceB "inherits" or "derives from" InterfaceA? "Implements" would be wrong, because InterfaceB doesn't provide an implementation. Semantically, deriving interfaces is very similar to deriving classes. C++, for example, doesn't distinguish between interfaces and classes at all.

提交回复
热议问题