/*委托因為靜態相對比較簡單,所以只是帶過,動態相對比較實用*/
using System;
using System.Collections.Generic;
using System.Text;
namespace Delegate
{
delegate void EatDelegate(string AFood);
class Program
{
static void Main(string[] args)
{
EatDelegate deleZS = new EatDelegate(Eat);
deleZS("西瓜");
}
static void Eat(string AFood)
{
Console.WriteLine(Console.ReadLine() + " 吃 " + AFood);
}
}
}