method hiding in c# with a valid example. why is it implemented in the framework? what is the Real world advantage?
问题 Can anyone explain the actual use of method hiding in C# with a valid example ? If the method is defined using the new keyword in the derived class, then it cannot be overridden. Then it is the same as creating a fresh method (other than the one mentioned in the base class) with a different name. Is there any specific reason to use the new keyword? 回答1: C# not only supports method overriding, but also method hiding. Simply put, if a method is not overriding the derived method, it is hiding it