Search code examples
.netoopinheritanceabstract-classimplements

Do we inherit or implement abstract classes?


I have noticed that MSDN is very careful about the terms "inherit" and "implement".

We implement interfaces, but inherit non-abstract classes. I suppose that full methods of abstract class are inherited, but abstract methods are implemented.

  • What term should we use when an abstract class consists of both full and abstract methods? Abstract class has no instances on one hand (this is a characteristic of an interface), on other hand it may contain full methods (this is a characteristic of a class).

Solution

  • I suppose that full methods of abstract class are inherited, but abstract methods are implemented.

    NO. Abstract methods(defintion) are overridden by base class' overriding methods.

    An abstract method declaration introduces a new virtual method but does not provide an implementation of that method. Instead, non-abstract derived classes are required to provide their own implementation by overriding that method.

    What term should we use when an abstract class consists of both full and abstract methods?

    The definition of abstract class itself states that it could contain methods defintions as well, but it should have at least one abstract method.

    Abstract class has no instances on one hand (this is a characteristic of an interface), on other hand it may contain full methods (this is a characteristic of a class).

    Abstract class is obviously a category of a class.