This thing is also a keyword when the function is declared, but it is not only the same as REF, OUT.
The biggest advantage of this thing is that you can do not know the number of parameters of this type, and the dynamic calls him.
For example, this function, the following two types of USAGE can be.
Useparams (1, 2, 3); UseParams (1, 2, 3, 4);
.............. ..
No Additional Parameters Are Permitted After the Params Keyword In A Method Declaration, And Only One Params Keyword IS Permitted in a Method Declaration.
EXAMPLE
// cs_params.cs
Using system;
Public Class Myclass
{
Public Static Void UseParams (params int [] list)
{
For (int i = 0; i Console.WriteLine (List [i]); Console.writeLine (); } Public static void useparams2 (params object [] list) { For (int i = 0; i Console.WriteLine (List [i]); Console.writeLine (); } Public static void main () { Useparams (1, 2, 3); Useparams2 (1, 'a', "test"); Int [] myarray = new int [3] {10, 11, 12}; Useparams (myarray); } } OUTPUT 1 2 3 1 a Test 10 11 12