using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Action委托
{
class Program
{
// **************************************************************************
// Action委托是系统提供的内置(预定义)的委托类型
// Action委托只能指向没有参数,且无返回值的方法
// 系统给Action委托进行了扩展,通过泛型,可以指向无返回值,但是有参数的方法
// **************************************************************************
/// <summary>
/// 自定义方法
/// </summary>
static void MyPrint()
{
Console.WriteLine("今天天气不错!");
}
/// <summary>
/// 自定义方法重载1
/// </summary>
/// <param name="a"></param>
static void MyPrint(int a)
{
Console.WriteLine(a);
}
/// <summary>
/
委托——Action委托使用
最新推荐文章于 2023-06-15 19:34:07 发布