# 命名参数 4.0引入了命名参数,命名参数让我们可以在调用方法时指定参数名字来给参数赋,还可以调整参数顺序 ```csharp static class Test{ public static List Find(string key, int number, bool sort){ Console.WriteLine("key:{0}, number:{1}, sort:{2}", key, number, sort); return new List(){}; } } ``` 以下对函数调用错误的是? ## 答案 ```csharp Test.Find(key:"hello", number:5); ``` ## 选项 ### A ```csharp Test.Find(key:"hello", number:5, sort:false); ``` ### B ```csharp Test.Find(key:"hello", sort:false, number:5); ``` ### C ```csharp Test.Find(sort:false, number:5, key:"hello"); ```