Does an inherited class automatically implement an interface from its base class?

Suppose I have a piece of code:

Public Interface ISomething
    ....
End Interface

Public Class SomeClass
  Implements ISomething
    ....
End Class

Now, if I inherit from SomeClass as follows:

Public Class InheritedClass
  Inherits SomeClass
    ....
End Class

Will InheritedClass automatically implement ISomething, or should I use Implements ISomethingInheritedClass in the definition?

+3
source share
2 answers

Yes, the interface will also be inherited.

+4
source

The interface is already implemented by the base class. Thus, your derived class will implement it, since it inherits the implementation of the base class. If you want to change the implementation of the base class, then you must declare a virtual implementation method so that you can override them.

+8
source

All Articles