title: How to init null-objects in array?
body: <pre><code>public static MyType mtOrders;    
  public static MyType mtCustomers;    
  public static MyType mtItems;    
  public static MyType mtGroups;    
  public static MyType mtDelieverAddresses;    
  public static MyType mtVendors;    
  public static MyType mtOrderItems;    
  public static MyType mtPrims;        
  
  public final static MyType[] xTable = {mtCustomers, mtGroups, mtItems, mtOrders,
                          mtDelieverAddresses, mtVendors, mtOrderItems, mtPrims};
  
  for (int i = 0; i &lt; xTables.length; i++) {    
    xTable[i] = new MyType();
  }
  </code></pre>
  
  <p>After executing <code>xTable</code>'s elements are initialized, but <code>mtOrders</code>... <code>mtPrims</code> are null!</p>
  
  <p>I understand why this is so, but I can not think how I initialize the objects in the loop.</p>
  
  <p>I do not want to do this:</p>
  
  <pre><code>mtOrders = new MyType();
  mtCustomers = new MyType();
  ...
  mtPrims = new MyType();
  </code></pre>