The default value must be one of the following in C# :
A constant expression;
An expression of the form new ValType(), where ValType is a value type, such as an enum or a struct;
An expression of the form default(ValType), where ValType is a value type."
The arrays you created don't follow any of the above rules of C#, and it is a reference type so there can be only one default value which is: null
And one more thing, Array is a reference type, so it initializes by new keyword so anything which initializes by new cannot be constant thus constant of the reference type is null
So You can use = null or = default
void Foo(string[] param = null) {
param = param==null ? new[] : param;
}
OR
void Foo(string[] param = default) {
}
nullto represent an empty array. What kind of default value do you actually need ?nulland prefer Null-objects.default(string[])which is pretty much the same as usingnull. dotnetfiddle.net/TRXdnyvoid Foo(params string[] myArr)