title: Interface vs Abstract Class (general OO)
body: <p>I have recently had two telephone interviews where I've been asked about the differences between an Interface and an Abstract class. I have explained every aspect of them I could think of, but it seems they are waiting for me to mention something specific, and I don't know what it is.</p>
  <p>From my experience I think the following is true. If I am missing a major point please let me know.</p>
  <p><strong>Interface:</strong></p>
  <p>Every single Method declared in an Interface will have to be implemented in the subclass.
  Only Events, Delegates, Properties (C#) and Methods can exist in an Interface. A class can implement multiple Interfaces.</p>
  <p><strong>Abstract Class:</strong></p>
  <p>Only Abstract methods have to be implemented by the subclass. An Abstract class can have normal methods with implementations. An Abstract class can also have class variables besides Events, Delegates, Properties and Methods. A class can implement one abstract class only due to the non-existence of Multi-inheritance in C#.</p>
  <ol>
  <li><p>After all that, the interviewer came up with the question &quot;What if you had an Abstract class with only abstract methods? How would that be different from an interface?&quot; I didn't know the answer but I think it's the inheritance as mentioned above right?</p>
  </li>
  <li><p>Another interviewer asked me, &quot;What if you had a Public variable inside the interface, how would that be different than in a Abstract Class?&quot; I insisted you can't have a public variable inside an interface. I didn't know what he wanted to hear but he wasn't satisfied either.</p>
  </li>
  </ol>
  <p><strong>See Also</strong>:</p>
  <ul>
  <li><p><a href="https://stackoverflow.com/questions/479142/when-to-use-an-interface-instead-of-an-abstract-class-and-vice-versa">When to use an interface instead of an abstract class and vice versa</a></p>
  </li>
  <li><p><a href="https://stackoverflow.com/questions/747517/interfaces-vs-abstract-classes">Interfaces vs. Abstract Classes</a></p>
  </li>
  <li><p><a href="https://stackoverflow.com/questions/558164/how-do-you-decide-between-using-an-abstract-class-and-an-interface-closed">How do you decide between using an Abstract Class and an Interface?</a></p>
  </li>
  <li><p><a href="https://stackoverflow.com/questions/1913098/what-is-the-difference-between-an-interface-and-abstract-class?rq=1">What is the difference between an interface and abstract class?</a></p>
  </li>
  </ul>