C# delegate

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApp1
{
    internal class Program
    {

        delegate void MyAction(string abc);

        static MyAction test = new MyAction(ShowABC);

        static void Main(string[] args)
        {
            test?.Invoke("Abc");
            Console.ReadKey();
        }
        static void ShowABC(string abc)
        {
            Console.WriteLine("ABC");
        }
    }
}

你可能感兴趣的:(c#,数据库,开发语言)