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

后端 未结 8 829
有刺的猬
有刺的猬 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:12

    What's all the excitement about? The multiple question marks and multiple exclamation points?

    Does it bother you that we can say a Book is Taxable, even though Taxable is an interface? Please calm down.

    There are different keywords in the language for a class' relationship to an interface and to a superclass, but the conceptual nature of that relationship is the same, therefore it's entirely reasonable to use the same English terms to describe it. A Book is Taxable, just as a Book is a Good. To bring the terms even closer, a Book is a TaxableItem. It's OK.

提交回复
热议问题