title: What is Function Calling Sequence OF Virtual Function In C#?
body: <p>I have this code : </p>
  
  <pre><code>namespace ConsoleApplicationDemo
  {
      class base 
      {
          public virtual void   Sum()
          {
              Console.WriteLine("Sum in base ");
          }
      }
      class Program:base 
      {
  
          public override void Sum()
          {
  
              Console.WriteLine("SUM  IN Program ");
          }
  
          static void Main(string[] args)
          {
  
              base A2 = new Program();
              A2.Sum();
              Program P2 = new Program();
              P2.Sum();
              Console.ReadLine();
          }
      }
  }
  </code></pre>
  
  <blockquote>
    <p>getting OutPUT: SUM  IN Program SUM  IN Program</p>
  </blockquote>
  
  <p>My question  is why base Class Sum FunCtion is not getting called by this code?</p>
  
  <pre><code>base A2 = new Program();
  A2.Sum();
  </code></pre>