内置的委托类型Action
//Action无返回值
static void Main(string[] args)
{
    Action<string> a = NormalFunc;
    a("Hei");

    Console.ReadKey();
}
        

static void NormalFunc(string str) {
    Console.WriteLine("I am NORMAL FUNCTION " + str);
}

Action是一个内置委托类型,通过泛型<T1,T2...>指定函数参数


首页 我的博客
粤ICP备17103704号