C# hack: low level difference between interface and abstract class

Viewed 1264

This is a philosophical question about C# fundamentals: I am wondering how close an interface may be simulated by fully abstract class. Assume we have following interface:

public interface INativeInterface
{
    void PerformAction();
    String Property { get; set; }
}

And following abstract class:

public abstract class ISimulatedInterface
{
    public abstract void PerformAction();
    public abstract String Property { get; set; }
}

They are having so much in common, aren't they? The differences I know are that:

  • Multiple inheritance does not work for abstract classes
  • Explicit implementation does not work abstract classes

Can these restrictions be skipped by using reflection or something like this?

I realize that interface and abstract class are different in root: interface declares a condition of "can behave like", abstract class - "is a kind of", but even this seems to be so close that a low level differences between these entities have to be discussed. This question can even sound like "What would you do to make an interface in C++".

4 Answers
Related