title: Method with same name and parameter but different return type
body: <p>I am wondering that why the following scenario is not working  in c#.</p>
  
  <pre><code>class a
  {
      public  int add(int a, int b)
      {
          return a + b;
      }
  
      public string add(int c, int d)
      {
           return "String : "+(c + d).ToString();
      }
  }
  </code></pre>
  
  <p>Since the following is working fine (in the case of inheritance)</p>
  
  <pre><code>class a
  {
      public  int add(int a, int b)
      {
          return a + b;
      }
  }
  
  class b : a
  {
      public string add(int c, int d)
      {
          return "String : "+(c + d).ToString();
  
      }
  }
  </code></pre>
  
  <p>Here if I am creating an object of <code>b</code> and <code>b.add(1,2)</code> returns <code>String:3</code></p>
  
  <p>n both case two <code>add</code> method having different return type ( am aware that against method overloading) , but it working fine in the case of inheritance but not in single class.</p>
  
  <p>Anybody knows the reason?  </p>