Methods in .NET - Parameter with variable number of arguments (Part 2)
The ref and out keywords are often used to change the behavior of parameters in a method. However, there’s a keyword that is much less known, but which is quite helpful: params. When using params, before any parameter declaration, it will allow us to provide a variable number of arguments when calling the method. The parameter using the params keyword contains the restriction that it has to be declared as an array.