title: What is the difference between interface and abstract class in Typescript?
body: <p>I wrote a couple of lines of code to experiment and differentiate between these two: <code>interface</code> and <code>abstract class</code>.</p>
  <p>I found out that they have the same restriction.</p>
  <pre><code>interface IPerson {
    name: string;
    talk(): void;
  }
  
  interface IVIP {
    code: number;
  }
  
  abstract class Person {
    abstract name: string;
    abstract talk(): void;
  }
  
  class ManagerType1 extends Person {
    // The error I get is that I need to implement the talk() method
    // and name property from its base class.
  }
  
  class ManagerType2 implements IPerson {
    // The error I get is that I need to implement the talk() method 
    // and the name property from the interface.
  }
  
  
  class ManagerType3 implements IPerson, IVIP {
    // Now the error I get is that I need to implement all the 
    // properties and methods of the implemented interfaces to the derived class
  }
  </code></pre>
  <p>As what I found is, there are no clear differences between these two since they both implement the same restriction. The only thing I notice is <strong>inheritance</strong> and <strong>implementation</strong>.</p>
  <ol>
  <li>A class can only extend to a single base class</li>
  <li>A class can implement multiple interfaces.</li>
  </ol>
  <p>Did I catch it right? If so when do I need to use one?</p>
  <blockquote>
  <p>UPDATE</p>
  </blockquote>
  <p>I do not know if this is the right answer but you can really use BOTH depending on your situation. OOP is really cool.</p>
  <pre><code>class ManagerType3 extends Person implements IPerson, IVIP {
    // Now the restriction is that you need to implement all the abstract
    // properties and methods in the base class and all 
    // the properties and methods from the interfaces
  }
  </code></pre>