It is possible to have a null params in c#, but why?
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/2210519/why-does-params-behave-like-this">Why does params behave like this?</a>  </p>
</blockquote>



<p>If you write a method like this:</p>

<p><code>void TestMethod(params object[] args) 
{
}</code></p>

<p>then if you call it like this: TestMethod() then the array will be empty.</p>

<p>and if you call it like this: TestMethod(null, null) then the array will be an array with two null values.</p>

<p>but why, when you call the method like this: TestMethod(null) will the array be null?</p>

<p>I would have expected the result to be an array with one null value.</p>

<p>I know about this <a href="http://stackoverflow.com/questions/6584131/c-is-it-possible-to-have-null-params">C# - Is it possible to have null params?</a> but does not explain why.</p>

<p>--Edit:</p>

<p>It's also interesting that TestMethod((object)null) is an array with one null value
and TestMetod((object[])null) is a null array.</p>

<p>It's just a case where being explicit in your intentions, by casting null to your expected type is the right way to go.</p>
