© { JSL }
34
params object[ ]
·
params
with
object
as the element type
w
creates a truly variadic function
w
thanks to boxing
static void
BlackHole(
params
object
[] row)
{
if
(row !=
null
)
Console.WriteLine(row.Length);
else
Console.WriteLine(
"null"
);
}
static void
Main()
{
BlackHole(
null
);
BlackHole();
BlackHole(1M);
BlackHole(
new int
[]{1,2});
BlackHole(1, 2.0,
"three"
);
}
null
0
1
1
3