javainheritanceabstract-classconcrete-inheritance

Concrete method in abstract class


I understand an abstract class may contain abstract and concrete methods (i.e with body implementation). My question are: can subclasses inherit/override concrete methods from an abstract superclass. And secondly do they have to implement concrete methods the same way they implement abstract methods?


Solution

  • can subclasses inherit/override concrete methods from an abstract superclass

    If they are not final, yes, they can be overriden.

    And secondly do they have to implement concrete methods the same way they implement abstract methods?

    No, they only need to implement/override the abstract ones, otherwise an abstract method wouldn't make sense.