步骤1:
delegate bool IsGreaterThan(int inputNumber);
步骤2:
static bool IsGreaterThan3(int number) { return number > 3 ? true : false; }
步骤3:
IsGreaterThan igt = new IsGreaterThan(IsGreaterThan3); Console.WriteLine("Number is greater than 3 : {0}", igt(4));
时间: 2024-08-28 14:29:35