C#中的 具名參數 和 可選參數

具名參數 和 可選參數 是 C# framework 4.0 出來的新特性。 一. 常規方法定義及調用 public void Demo1(string x, int y) { //do something... } public void Main() { //調用 Demo1("similar", 22); } 調用時,參數順序(類型)必須與聲明一致
相關文章
相關標籤/搜索