title: Not entering Equals() method in a class derived from Object
body: <p>In the exact setup:</p>
  <pre><code>namespace NS
  {
      class Program
      {
          static void Main(string[] args)
          {
              Object obj1 = new A();
              Object obj2 = new A();
              Console.WriteLine(obj1.GetType());
              Console.WriteLine(obj2.GetType());
  
              Console.WriteLine(obj1.Equals(obj2)); // why not entering A::Equals(A a)
              Console.ReadLine();
          }
      }
      class A
      {
          int x;
          public bool Equals(A a)
          {
              Console.WriteLine(&quot;enters Equals&quot;);
              return this.x == a.x;
          }
      }
  }
  </code></pre>
  <p>I have the output from console app in C#:</p>
  <pre><code>NS.A
  NS.A
  False
  </code></pre>
  <p>Question: If <code>ojb1</code> and <code>obj1</code> are of type NS.A why <code>public bool Equals(A a)</code> is not entered?</p>
  <p>Is <code>Console.WriteLine(obj1.GetType());</code> &quot;lies&quot; about a real object type. I am confused?</p>
  <p>I wanted to call <code>A.Equals(A)</code> method from code even though <code>Object obj1 = new A();</code></p>
  <p>I know I can fix the problem with <code>A obj1 = new A();</code> but I am stuck with understanding why <code>GetType()</code> returns the <code>A</code> and I cannot call the <code>A.Equals(A)</code>.</p>