title: C# call an interface method non-virtual implementation
body: <p>I am new to C# and I don't understand why compiler does not complain on this code. Here is the hierarchy of classes:</p>
  
  <pre><code>interface IAble
  {
      void f();
  }
  
  class AAble : IAble
  {
      public void f()
      {
          Debug.Log("----&gt;&gt; A - Able");
      }
  }
  
  class BAble : AAble
  {
      public void f()
      {
          Debug.Log("----&gt;&gt; B - Able");
      }
  }
  </code></pre>
  
  <p>execution code:</p>
  
  <pre><code>        IAble i = new BAble();
          i.f();
  </code></pre>
  
  <p>On execution <code>----&gt;&gt; A - Able</code> was printed. Why? How the compiler knows what function should be called?</p>
  
  <p><strong>When the decision is made of what function to call - runtime or compile time?</strong> What if I defile a new class <code>class CAble : IAble</code>?</p>