Recently we have seen the basics.
There is a little bit of understanding when you see the rewrite (new) and overwrite (override) method.
So Baidu's.
The answer .....
Either the overwrite (override) and the overload (Overlord) are confused.
Either the rewrite (new) and overwrite (override) are reversed.
Last resort to Google.
See a better answer in StackOverflow:
--------------------------------------------------------------------------------------------------------------- -------------------------------------------------------------------------
Virtual: Indicates that a function is overriden by an inheritor
override: Overrides the functionality of a virtual function in a base class, providing different functionality.
New: hides the original function (which doesn ' t has to be virtual), providing different functionality. This should only being used where it is absolutely necessary.
When you hide a method, you can still access the original method by up casting to the base class. This was useful in some scenarios, but dangerous.
--------------------------------------------------------------------------------------------------------------- -------------------------------------------------------------------------
The translation is (please correct me in the wrong place, TKS):
Override (Overwrite):
Virtual: Indicates that this method may be overridden by the successor (Child method) (override)
Override: Override virtual methods in base class to provide different implementation methods
New (Override):
Hides the original method (not necessarily the virtual method), providing a different implementation method. This (rewrite) should be used only where it is necessary (that is, it is not recommended in general places).
When you hide a method, you can still access the original method by pointing to the base class. This is useful in some scenarios, but more dangerous.
--------------------------------------------------------------------------------------------------------------- -------------------------------------------------------------------------
So
Override is generally an extension of the original virtual method , and the original method must be prefixed with the virtual modifier.
New is generally used to extend the original non- virtual method, but it is not recommended.
Personal understanding, if not right, generous enlighten!
C # Basic-method override (new) and overwrite (override)