abstract classes and interfaces best practices in java

前端 未结 5 2201
无人及你
无人及你 2021-02-10 08:57

So you\'ve got an interface and an abstract class that implements a subset of the methods in the interface. You\'ve also got some classes that inherit the abstract class and giv

5条回答
  •  时光取名叫无心
    2021-02-10 09:40

    The abstract class should implement the interface, and provide concrete implementations of common member functions. IIRC it shouldn't need to declare abstract methods for the elements it doesn't implement, as these are assumed to be needed to be implemented by subclasses.

提交回复
热议问题