When to implement an interface and when to extend a superclass?

后端 未结 11 873
遇见更好的自我
遇见更好的自我 2020-11-30 04:41

I\'ve been reading a lot about interfaces and class inheritance in Java, and I know how to do both and I think I have a good feel for both. But it seems that nobody ever rea

11条回答
  •  不知归路
    2020-11-30 05:27

    I found some articles, particularly some who describe why you should not use implementation inheritance (i.e. superclasses):

    • Why extends is evil
    • Inheritance of implementation is evil
    • Implementation inheritance
    • Implementation inheritance
    • Java inheritance FAQ

提交回复
热议问题