课后作业 10 ---多种引用方法的练习

     class Program
    {
        static void Method()//无参数 无返回值方法
        {
            Console.WriteLine("欢迎使用!");
        }
        static void Method(int i)//有参数 无返回值方法
        {

            Console.WriteLine("欢迎使用版本" + i);
        }
        static string Method1(int i )//有参数 有返回值方法
        {
            Console.WriteLine("欢迎使用版本" + i);
            return "会给您更好的体验";
        }
        static void Main(string[] args)
        {
            Console.WriteLine("无参数 无返回值的方法引用:");
            Method();

            Console.WriteLine("有参数 无返回值的方法引用");
            Method(5);

            Console.WriteLine("有参数 有返回值的方法引用:");
            string str = Method1(6);
            Console.WriteLine(str);

            Console.ReadLine();
        }
    }

 

posted @ 2015-08-12 21:52  WhyToHow  阅读(174)  评论(0编辑  收藏  举报