//no parameter, no return value, with action non-generic delegate;Action action = () = Console.WriteLine ("no parameter, action with no return value"); Action (); //With parameters, no return value, with action generic delegate;//The action<> generic delegate has 15 overloads, from 1 parameters to 15 parameters;//1 parameters, no return valueaction<int> action1 = n =Console.WriteLine (n.tostring ()); Action1 (123);//returns the result "123"//2 parameters, no return valueaction<string,int> Action2 = (s, i) = Console.WriteLine ("first parameter Value--{0}, second parameter value--{1}", S,i); Action2 ("haha",456);//returns the result "first parameter value--haha, second parameter value--456"//3 parameters, no return value .... 15 parameters no return value .... //there are or no parameters, but there are 1 return values with the func<> generic delegate, but one thing to note is that the return value type must be written in the last;func< parameter 1, parameter 2, Parameter 3 .... , return value type >//no parameters, with return valuesfunc<string> func = () = {return "no parameters, but there is a return value"; }; Console.WriteLine (func ());//returns the result "no parameter, but has a return value"//has a parameter that has a return valuefunc<int,string> func2=n=>{return(n2). ToString ();}; Console.WriteLine (Func2 (5));//returns the result "ten"Console.read ();
"Original" Generic delegate