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++一样。支持默认值了。
-- From Bndy.Net
Method declaration:
public static void SomeMethod(int optional = 0) { }
Method calls:
SomeMethod(); // 0 is used in the method.
SomeMethod(10);
见到以上代码,让我想到了C++,终于可以和C++一样。支持默认值了。