Is there any relation between the class that implements interface and that interface?

后端 未结 8 815
有刺的猬
有刺的猬 2020-12-19 16:56

Consider this class hierarchy:

  • Book extends Goods
  • Book implements Taxable

As we know, there is a relationship

8条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-19 17:28

    Yes. The relationship is exactly the same

    Book is a Taxable too.

    EDIT

    An interface is an artifact that happens to match Java's ( and probably C# I don't know ) interface keyword.

    In OO interface is the set of operations that a class is 'committed' perform and nothing more. Is like a contract between the object class and its clients.

    OO programming languages whose don't have interface keyword, still have class interface OO concept.

提交回复
热议问题