When you call SomeMethod on instance A (i.e. A foo = new <A or derived>() ), you expect to get the most derived version of SomeMethod . This is the whole point of inheritance. Your code only needs to deal with instances of the base class, but if these instances really have a derived class, a special hidden implementation is called. This is the behavior that you get when you override a method.
This explains common scenarios such as
A b = new B(); b.SomeMethod();
With new you do not override the method, you declare a new method with the same name. This method exists only for the class that declared it and its children, it is not part of the base classes and their inheritance chain.
So what does A a = new D(); a.SomeMethod(); A a = new D(); a.SomeMethod(); ? The variable is declared as A , therefore any methods / properties / etc displayed against it must be defined on A C defined a new SomeMethod method (and D overrides it), but this method does not exist on A , so it cannot be called here. The most derived implementation of SomeMethod (as indicated by type A ) is in B , so this is the implementation that is invoked.
The same story for B b = new D(); b.SomeMethod(); B b = new D(); b.SomeMethod();
This is only when we get to C c = new D(); c.SomeMethod() C c = new D(); c.SomeMethod() so that the new method has the ability to execute. This is because the variable is C , and therefore the new SomeMethod method is first declared in the variable type. And, as stated above, the most derivative possible version is called, which in this case means that the version is overridden by D
And I hope that we are all on the same page for D d = new D(); d.SomeMethod() D d = new D(); d.SomeMethod() :)
Others posted good links. Here is another thread that might help: C # and the hide method
And the last example shows an even stranger scenario when the "new" method is declared as private, so the next fogged type inherits the base version of the method, and does not inherit the "new" version. http://msdn.microsoft.com/en-us/library/aa691135