C#4.0 参数默认值

 

Method declaration:
public static void SomeMethod(int optional = 0) { }

Method calls:
SomeMethod(); // 0 is used in the method.
SomeMethod(10);

 

见到以上代码,让我想到了C++,终于可以和C++一样。支持默认值了。

posted @ 2010-04-27 08:24  bndy  阅读(980)  评论(2编辑  收藏  举报