2013年7月18日
摘要: 1.可选参数可以为方法的参数设置一个默认值,如下:class Program { static void Main(string[] args) { Show(); Show("cary"); Console.ReadLine(); } public static void Show(string msg = "") { Console.WriteLine("Hello {0}",msg); } }2.命名参数上面的Show方法可以象下面的方式调用:Show(msg:"cary");当你的方法有多个同一类型的可选参 阅读全文
posted @ 2013-07-18 11:22 鸿雁飞舞 阅读(177) 评论(0) 推荐(0) 编辑