It is advised to use override instead of new key word in C#. Why that rule?
"new" means you've got two completely different methods as far as the CLR is concerned - they happen to have the same name, but they're unrelated in terms of inheritance. That means that if you run:
Base b = new Derived();
Derived d = new Derived();
b.MyMethod(); // Calls Base.MyMethod
d.MyMethod(); // Calls Derived.MyMethod
This can make for some very hard-to-understand code.
Usually if you want different methods, call them different things. The normal reason to use the same name (and signature) is to override the behaviour of a base class's method. At that point you don't have any choice but to keep the name/signature the same.
I'm still trying to work out what the use case is for "new" aside from horrid hackery.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With