<> heavy load (overload):
A method in one class has the same name as another , But the parameter list is different , This method is called overload method . Simple notation :
Two same and different : similar , Same name ( Method name ), Different ginseng . The type of returned result is not required ( Can be the same but different ), The example effect is as follows : class Program { static void
Main(string[] args) { overLoad load = new overLoad();
Console.WriteLine(load.Speak()); Console.WriteLine(load.Speak("cat"));
Console.WriteLine(load.Speak(3)+": I am overloaded , return float type "); Console.ReadKey(); }
#region heavy load : Two same and different ( similar , Same name , Different ginseng ), Random return type public class overLoad // In the same category Speak Method to overload {
public string Speak() // Empty ginseng , return string type { return "1: I am overloaded , return string type "; } public
string Speak(string animal) // afferent string parameter , return string type { return string.Format(
"2: I am overloaded , Return type {0}",animal.GetType()); } public float Speak(float i)
// afferent float parameter , return float type { return i; } } #endregion }
The operation results are as follows :

<> rewrite (override):
When a subclass inherits a parent , And the names of the methods in the subclass and the methods in the parent class , Number of parameters , When all types are identical , It is said that this method in the subclass overrides the method in the parent class .
Three same and different : Same name , Isoparametric , Simultaneous return , Different classes , Different method bodies executed but same result type returned class Program { static void Main(string[]
args) { Dog dog = new Dog(); dog.Say(); } public class Animal // Superclass { public
virtual void Say() // Method in parent class virtual,abstract statement { Console.WriteLine("Oh~Oh~Oh");
} } public class Dog : Animal // Subclass { public override void Say() // Overriding the method of keyword declaration in the parent class
{ Console.WriteLine("Wang~Wang~Wang"); } } }
Run as follows :

<> summary : heavy load —— Two same and different ; rewrite —— Three same and different

Technology
©2019-2020 Toolsou All rights reserved,
( Essence 2020 year 6 month 2 Daily update ) TypeScript Function explanation use VS2019 “Windows Desktop applications ” Module creation Win32 window Hackbar Using the tutorial vue use vue-clipboard2 Realize the function of copy link Spark SQL- programming Vue Transfer parameters and receiving of page Jump be based on STM32 Design of infrared obstacle avoidance car ( There is a code )keras Data generator -- Data enhancement [AndroidO] [RK3399] -- GPIO Drive and control mode Vue el-select obtain label value