title: Default implementation of a method for C# interfaces?
body: <p>Is it possible to define an interface in C# which has a default implementation? (so that we can define a class implementing that interface without implementing that particular default method).</p>
  
  <p>I know <strong>extension methods</strong> (as explained in <a href="https://stackoverflow.com/questions/20416919/c-sharp-using-extension-methods-to-provide-default-interface-implementation">this link</a> for example). But that is <strong>not</strong> my answer because having a method extension like the following, the compiler still complains about implementing MyMethod in MyClass:</p>
  
  <pre class="lang-cs prettyprint-override"><code>public interface IMyInterface
  {
      string MyMethod();
  }
  
  public static class IMyInterfaceExtens
  {
      public static string MyMethod(this IMyInterface someObj)
      {
          return "Default method!";
      }
  }
  
  public class MyClass: IMyInterface
  {
  // I want to have a default implementation of "MyMethod" 
  // so that I can skip implementing it here
  }
  </code></pre>
  
  <p>I am asking this because (at least as far as I understand) it is possible to do so in Java (see <a href="https://docs.oracle.com/javase/tutorial/java/IandI/defaultmethods.html" rel="noreferrer">here</a>).</p>
  
  <p>PS: having an <strong>abstract base class</strong> with some method is also <strong>not</strong> my answer simply because we don't have multiple inheritance in C# and it is different from having a default implementation for interfaces (if possible!).</p>