using System; using System.Reflection; using System.Collections.Generic; using System.Text; namespace TestSpace{ delegate bool Predicate < T > (T value); class x { static bool F( int i) { return true ; } static bool G( string s) { return false ; } static void Main() { Predicate < string > p2 = G; // false Predicate < int > p1 = new Predicate < int > (F); // true bool a = p1( 1 ); bool b = p2( " 2 " ); Console.WriteLine(b); Console.WriteLine(a); Console.ReadLine(); } }}