Abstract classes and methods in Java, Inheritance

后端 未结 5 886
星月不相逢
星月不相逢 2021-02-14 15:22

I have class B, which inherits from class A. The superclass A is abstract, containing one abstract method. I don\'t want to implement the abstract method in class B, therefore I

5条回答
  •  抹茶落季
    2021-02-14 15:58

    Go with #1. Rewriting the method declaration in the child class is confusing. And you actually don't need any abstract methods in an abstract class, regardless of whether the parent is abstract or not.

提交回复
热议问题