1 code
1 using System; 2 using System.Collections.Generic; 3 using System.Linq; 4 using System.Text; 5 using System.Threading.Tasks; 6 7 namespace ConsoleApplication2 8 { 9 //返回类型为void的无参数委托 10 public delegate void MyFirst(); 11 class Program 12 { 13 static void Main(string[] args) 14 { 15 MyFirst helloWorld = delegate () { Console.WriteLine("hello world"); }; 16 helloWorld(); 17 Console.ReadKey(); 18 } 19 } 20 }
2 show
时间: 2024-10-10 07:52:10