1// Using the range of int i we assign new objects to the List using i as the index
2List<Objects> objects = new ArrayList<>();
3
4for (int i = 0; i < 10; i++)
5{
6 // Generate or get variables
7 objects.add(i, new Object(variable, variable1));
8}
9