title: How to elegantly populate a heterogeneous array in c#
body: <p>I have 3 different classes (1 parent and 2 children), and I have created a heterogeneous array:</p>
  
  <pre><code>Parent[] parentArray =  new Parent[9];
  </code></pre>
  
  <p>I would like to populate this array with 3 Parent objects, 3 child1 objects, and 3 child2 objects, in that order. </p>
  
  <p>I would like to know if there is a more elegant way to do it than just doing this:</p>
  
  <pre><code>parentArray[0] = new Parent();
  
  parentArray[1] = new Parent();
  
  parentArray[2] = new Parent();
  
  parentArray[3] = new Child1();
  
  parentArray[4] = new Child1();
  
  ....
  
  parentArray[9] = new Child2();
  </code></pre>
  
  <p>Thanks!</p>