title: Why does the compiler cast automatically without going further in the inheritance?
body: <p>While I try to run following code snippet, it’s executing wrong overload method. I'm confused why it does that?   <em>[<code>testB.TestMethod(testValue)</code> method execute the  <code>public double TestMethod(double value)</code> method]</em></p>
  
  <pre><code>public class TestA
  {
      public int TestMethod(int value)
      {
          return value;
      }
  }
  
  public class TestB : TestA
  {
      public double TestMethod(double value)
      {
          return value;
      }
  }
  
  static void Main( string[] args )
  {
      TestB testB = new TestB();
  
      int testValue = 3;
  
      testB.TestMethod(testValue);
  }
  </code></pre>
  
  <p>Do you have any idea about this ?</p>
  
  <p>Is there are any way to call TestA class method via the TestB instance without cast as TestA.?</p>
  
  <p><strong>But it is not happen in JAVA and C++</strong></p>