title: Can you override one of the abstract methods in a base class with another base class?
body: <p>I have a base class that has some abstract methods on it and there are 21 classes that are inheriting from this base class.  Now for one of those abstract methods I want to implement it with a common implementation for 6 of the 21 classes so I thought about creating another base class that would do this.</p>
  
  <p>I am open to suggestions but my main purpose of creating another base class between the current base class and the 21 classes is to keep from repeating the same code in 6 of the 21 classes if I didn't have to.</p>
  
  <p>Here is a sample of code to illustrate the situation:</p>
  
  <pre><code>public abstract class FooBase
  {
     public abstract string Bar();
     public abstract string SomeMethod();
     public virtual string OtherMethod()
     {
         return this.SomeMethod();
     }
  }
  
  public abstract class AnotherBase : FooBase
  {
     public abstract string Bar();
     public abstract string SomeMethod();
     public override OtherMethod()
     {
        //this is the common method used by 6 of the classes
        return "special string for the 6 classes";
     }
  }
  
  public class Foo1 : FooBase
  {
     public override string Bar()
     {
        //do something specific for the Foo1 class here
        return "Foo1 special string";
     }
     public override string SomeMethod()
     {
        //do something specific for the Foo1 class here
        return "Foo1 special string";
     }
  }
  
  public class Another2 : AnotherBase
  {
     public override string Bar()
     {
        //do something specific for the Another2 class here
        return "Another special string";
     }
     public override string SomeMethod()
     {
        //do something specific for the Another2 class here
        return "Another2 special string";
     }
  }
  </code></pre>