The following concepts have been vague:
Overload (overload) Key Words: None 1. used: in the same class. (Actually, different versions of methods with the same name in the same class
A name)
2. Requirements for methods to be reloaded and methods to be reloaded: The parameter list is different or the return type is different or
Different users
Overwrite (rewrite) Keyword: New is used to inherit from the parent class and is the same as the method name of the new keyword.
The method is invalid, just as it does not exist in the parent class. As long as the method name is the same, there is no need for anything else.
.
Override (overwrite) Keyword: override
1. The override method must be of the parent class (direct parent class or indirect parent class (that is, the parent class of the Top N layer ).
(Class) virtual methods or abstract methods, where abstract methods must be overwritten.
2. The three parts must be the same
The same method name;
The same parameter list;
Returns the same type.
Baidu knows that a renxiong wrote:
Overload is a completely new method. The parameters are different from the original method.
Override overwrites the inherited method, which is still not abandoned.
Overwrite overwrites the code of the inherited method. The original method is abandoned.