diff --git a/docs/csharp/language-reference/keywords/params.md b/docs/csharp/language-reference/keywords/params.md index 05e87dded084e..2cc4d4be594a4 100644 --- a/docs/csharp/language-reference/keywords/params.md +++ b/docs/csharp/language-reference/keywords/params.md @@ -1,5 +1,5 @@ --- -title: "params keyword - C# Reference" +title: "params keyword for parameter arrays - C# reference" ms.date: 07/20/2015 f1_keywords: - "params_CSharpKeyword" @@ -7,17 +7,22 @@ f1_keywords: helpviewer_keywords: - "parameters [C#], params" - "params keyword [C#]" + - "parameter array" ms.assetid: 1690815e-b52b-4967-8380-5780aff08012 --- # params (C# Reference) -By using the `params` keyword, you can specify a [method parameter](method-parameters.md) that takes a variable number of arguments. - -You can send a comma-separated list of arguments of the type specified in the parameter declaration or an array of arguments of the specified type. You also can send no arguments. If you send no arguments, the length of the `params` list is zero. +By using the `params` keyword, you can specify a [method parameter](method-parameters.md) that takes a variable number of arguments. The parameter type must be a single-dimensional array. No additional parameters are permitted after the `params` keyword in a method declaration, and only one `params` keyword is permitted in a method declaration. -The declared type of the `params` parameter must be a single-dimensional array, as the following example shows. Otherwise, a compiler error [CS0225](../../misc/cs0225.md) occurs. +If the declared type of the `params` parameter is not a single-dimensional array, compiler error [CS0225](../../misc/cs0225.md) occurs. + +When you call a method with a `params` parameter, you can pass in: + +- A comma-separated list of arguments of the type of the array elements. +- An array of arguments of the specified type. +- No arguments. If you send no arguments, the length of the `params` list is zero. ## Example