Where did the concept of Interfaces come from?

后端 未结 18 2109
有刺的猬
有刺的猬 2021-01-11 18:45

In c#, we have interfaces. Where did these come from? They didn\'t exist in c++.

18条回答
  •  轻奢々
    轻奢々 (楼主)
    2021-01-11 19:26

    i've seen the keyword interface first in java, but they are much older than that.

    the same concept exists in c++ but it is not exactly the same. They are called "pure virtual classes"

    http://en.wikipedia.org/wiki/Virtual_function

    They exists with different syntax but are there to allow polymorphism in OOP.

提交回复
热议问题