A Method signature consists of a method name and a parameter list (the order and type of parameters.
Note: The method signature does not include the return value of the method. Although each overload method can have different return types, a single return type is not enough to distinguish which method is used.
In C #, two or more methods in the same class can have different names, as long as their parameter declarations are different. In this case, this method is called overload. This process is called method overloading ). Method Overloading is one of the most useful features of C.
When a method is called, C # uses the method signature to determine which method to call. Therefore, the parameter list of each overload method must be different. Although each overload method can have different return types, a single return type is not enough to distinguish which method is used. When C # Calls an overloaded method, the method that matches the parameters of the parameter is executed.
Override refers to the further improvement of the implementation of the base class method by the derived class.
You cannot override non-virtual or static methods. The override base method must be virtual, abstract, or override. Why can override be rewritten? Because the override in the base class is actually a rewriting of the base class, because inheritance can be passed, you can also override the override method in the base class.
Override declares that the accessibility of the virtual method cannot be changed. The override and virtual methods must have the same access level modifier.
You cannot use modifiers new, static, virtual, or abstract to modify the override method.
The override attribute declaration must specify the access modifier, type, and name exactly the same as the inherited attribute, and the overwritten attribute must be virtual, abstract, or override.