This is Micosoft's definition for the new keyword: "The warning says that the Method2 method in DerivedClass hides the Method2 method in BaseClass." (https://learn.microsoft.com/en-us/dotnet/csharp/programming-guide/classes-and-structs/knowing-when-to-use-override-and-new-keywords)
I just can't seem to wrap my head around why it is defined as "hiding the implementation of the base class". Why does it use base class' implementation instead of derived class' implementation, if it actually "hides" the base class' implementation? It just seems to me the use of word "hide" contradicts to how it actually works, and that explanation leans toward what keyword override is actually doing; using the derived class' implementation instead of base class' implementation.
I would appreciate any answer that clears up my confusion on this "base class implementation hiding" by using the new keyword. Thanks all!
newcreates a member with the exact same name that has nothing to do with the hidden member. However you can´t access the hidden member, unless you cast that instance to the base-class. Actually you have two members with the exact same name, so you have to indicate in some way which one you want to use.Fooimpelemented by derived