using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Collections.ObjectModel;
namespace ConsoleApplication1
{
class Program
{
delegate T MyAdd<T>(T a, T b);
static void Main(string[] args)
{
var methodInt = new MyAdd<int>(Add); ;
Console.WriteLine(methodInt(100, 100));
var methodString = new MyAdd<string>(Add);
Console.WriteLine(methodString("ganquan", "fu"));
Console.Read();
}
private static int Add(int n,int m)
{
return n + m;
}
private static string Add(string n,string m)
{
return n + m;
}
}
}