You can also do this in a line - make an array and fill it with the values ββstarted with their constructors right away. Suppose you have a class called "Field" that has a constructor with two parameters, and you want to build an array of these ...
Field[] fields = new Field[]{ new Field(1, "Record_Type"), new Field(3, "Record_SubType"), new Field(6, "Row_Number"), ... };
source share