Memi Lavi writes about inherits vs. implements in C#, and that the difference gets much more obvious with VB. He also talks about multiple inheritance with interfaces is not possible.
Mostly I'm writing my programs with C# (sometimes C++ and VB). Now I've done some VB code to see the difference.
Multiple inheritance is possible with interfaces, and VB also uses the Inherits keyword here:
Public Interface IA
Sub A()
End Interface
Public Interface IB
Sub B()
End Interface
Public Interface IC
Inherits IA, IB
Sub C()
End Interface
Multiple inheritance with interfaces.
With C# it is possible that a class derives from an interface but gets the interface implementation from an abstract base class. The C# code is here:
public interface IA
{
void A();
}
public abstract class XA
{
public void A() { }
}
public class X : XA, IA // get the implementation of IA from XA
{
}
Such a scenario seems not possible with VB. With the Implements keyword of VB, always an implementation is needed.
Of course the code can be changed, so that the abstract class implements the interface.
Christian