Ok so i’m working on adding a list of about 120 or so specific arrays into an array list
(These are just hypothetical values and names, but the same concept
private ArrayList<int[]> listofNames = new ArrayList<int[]>();
private static int[] NAME_0 = {x, x, x};
private static int[] NAME_1 = {x, x, x};
private static int[] NAME_2 = {x, x, x};
private static int[] NAME_3 = {x, x, x};
Is there a way I can use a for loop to get through NAME_0 to say NAME_120?
You could use reflection, but you almost certainly shouldn’t.
Instead of using variables with numbers at the end you should generally use an array of arrays instead. This is what arrays are for, after all.
If you’re just adding these all to an ArrayList you can probably just use an initializer block instead: