1. overridingOverride: Also known as overwrite. subclasses redefine virtual functions in the parent class that have the same name and argument list. function features are the same.
Overrides need to be noted:
1) The overridden function cannot be static.it has to be virtual.2) The overriding function must have the same type, name, and parameter list 3) the access modifiers of the overridden function can be different. Although virtual is private, overriding in a derived class can be rewritten as public,protected 2.
Heavy Duty Overload: The function name is the same, the parameter list and other characteristics are different. But it cannot be judged by the return type. 3.Redefine
redefiningAlso called hiding:
Subclasses redefine non-virtual functions with the same name in the parent class (the argument list can be different).
in summary, summarized as follows:
1 Overloaded Features:
A the same range (in the same class) The
b function has the same name
c parameter is different
d virtual keyword is optional
2 override (overwrite) refers to a derived class function that overrides a base class function, characterized by:
a different range, located in the base class and the derived class, respectively
The name of the B function is the same
same as C parameterThe
D base class function must have the virtual keyword
3 redefinition (hidden) refers to a function of a derived class that masks a base class function with the same name as the following rule:
a If the function of the derived class and the function of the base class have the same name, but the arguments are different, at this point, the function of the base class is hidden, regardless of whether or not virtual.
b If the function of the derived class has the same name as the function of the base class, and the parameters are the same, but the base class function does not have the Vitual keyword, the function of the base class is hidden.
Differences between parent-child classes, member function overrides, overloads, and redefinition