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 < xTables.length; i++) {
xTable[i] = new MyType();
}
After executing xTable's elements are initialized, but mtOrders... mtPrims are null!
I understand why this is so, but I can not think how I initialize the objects in the loop.
I do not want to do this:
mtOrders = new MyType();
mtCustomers = new MyType();
...
mtPrims = new MyType();