text: I got an e-mail earlier this week asking a fairly common question regarding C#’s
  overload resolution. Before I launch into a discussion of the actual behavior
  of the compiler, think about what the output of the following program will
  be:
  using System;
  public class Program {
  public static void Main() {
  Derived d = new Derived();
  Console.WriteLine(d.Method("My String"));
  }
  }
  public class Base {
  public virtual string Method(string s) {
  return "Base.Method(string)";
  }
  }
  public class Derived : Base {
  public override string Method(string s) {
  return "Derived.Method(string)";
  }
  public virtual string Method(object o) {
  return "Derived.Method(object)";
  }
  }.
  CLR Week: A new annual tradition.
  Correct? Yes. Sensible? Not necessarily.
  As Eric Gunnerson points out, the overload resolution rules (look in the current class, and only if nothing matches go to the parent) are there for the sake of versioning, so that the derived class is protected from changes in the base. I cannot see a way in which this particular detail helps with versioning in any way. If the base's Method changes signature, the override keyword already forces the programmer to update the derived class. If another method is added to base, nothing happens, because the methods exists only in base.
  But not considering a method that appears in derived only adds confusion for the programmer, IMO, and no safety against changes.
  PingBack from