namespace out_ref { //声明一个委托 public delegate int Add(int n1,int n2); class Program { //拉姆达表达式 static void Main(string[] args) { Add a = (n1,n2) => n1 - n2; int c = a(10, 5); Console.WriteLine(c); Console.ReadKey(); } } }
时间: 2024-10-06 15:55:35
namespace out_ref { //声明一个委托 public delegate int Add(int n1,int n2); class Program { //拉姆达表达式 static void Main(string[] args) { Add a = (n1,n2) => n1 - n2; int c = a(10, 5); Console.WriteLine(c); Console.ReadKey(); } } }