コード例 #1
0
ファイル: Program.cs プロジェクト: icegithub/csharp-exercise
 delegate string MyDelegate();//声明委托
 static void Main(string[] args)
 {
     Helloworld hello = new Helloworld();
     MyDelegate h = new MyDelegate(hello.HelloCN);
     Console.WriteLine(h());
     h = new MyDelegate(hello.HelloEN);
     Console.WriteLine(h());
 }
コード例 #2
0
        delegate string MyDelegate();//声明委托

        static void Main(string[] args)
        {
            Helloworld hello = new Helloworld();
            MyDelegate h     = new MyDelegate(hello.HelloCN);

            Console.WriteLine(h());
            h = new MyDelegate(hello.HelloEN);
            Console.WriteLine(h());
        }