Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 10 additions & 5 deletions docs/csharp/language-reference/keywords/params.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,28 @@
---
title: "params keyword - C# Reference"
title: "params keyword for parameter arrays - C# reference"
ms.date: 07/20/2015
f1_keywords:
- "params_CSharpKeyword"
- "params"
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

Expand Down