abstract classes and interfaces best practices in java

前端 未结 5 2097
一个人的身影
一个人的身影 2021-02-10 08:37

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:29

    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.

提交回复
热议问题