首页 > 其他 > 详细

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

时间:2015-08-12 23:18:22      阅读:228      评论:0      收藏:0      [点我收藏+]
     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();
        }
    }

 

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

原文:http://www.cnblogs.com/whytohow/p/4725676.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!