C# 委托数组.
时间:2010-10-07 来源:胖子黎
using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace ConsoleApplication1 { /// ///定义两个操作方法 /// class MathOperations { public static double MultilyByx2(double value) { return value * 2; } public static double Square(double value) { return value * value; } } /// /// 定义委托 /// /// /// delegate double DoubleOp(double value); class Program { /// /// 委托数组 /// /// static void Main(string[] args) { DoubleOp[] operations = { new DoubleOp(MathOperations.MultilyByx2), new DoubleOp(MathOperations.Square) }; for (int i = 0; i
相关阅读 更多 +