List creation and object initializers in C#
<p>I'm struggling to get my head around what's happening with the List in the example below:</p>

<pre><code>public class DataObject
{
    public List&lt;object&gt; SomeObjects { get; set; }
}

class Program
{
    static void Main(string[] args)
    {

        var dataObj = new DataObject()
                          {
                              SomeObjects = { new object() },
                          };

        Console.ReadKey();
    }
}
</code></pre>

<p>Creation of <code>dataOjb</code> obviously fails because the <code>SomeObjects</code> property hasn't been instantiated. I assume that there's no compile error because <code>DataObject</code> could have a constructor that instantiated <code>SomeObjects</code>. Given that, if I attempt to do something like:</p>

<pre><code>List&lt;int&gt; SomeObjects;
SomeObjects = {1, 2, 3, 4};
</code></pre>

<p>This obviously doesn't work, and neither does:</p>

<pre><code>List&lt;int&gt; SomeObjects = new List&lt;int&gt;();
SomeObjects = {1, 2, 3, 4};
</code></pre>

<p>So to get to my actual question, what is that called in the first object initializer (I've tried looking it up and can't find it), why does it behave differently, and are there other places it can be used like this?</p>
