今天尝试着温习了一下委托的概念,代码如下:
        private delegate string mydelegate();
        
        static void Main(string[] args)
        {
            int x = 40;
            mydelegate md = new mydelegate(Method);
            Console.WriteLine(md);
            Console.ReadLine();
        }        public static string Method()
        {
            return "hello world!";
        }
希望输出hello world!,但实际结果却如下图所示:就这么几行代码,是哪儿的问题呢?