(SOLVED) Help with Multidimensional array practice
I have really bad ADHD and I can't really write all this code properly, I'm trying to reference arrPosition to the first part of the nested for loop. I had a feeling it wouldn't work because you cant call something that's initialized later. However, I have no clue how to work around it and there's too much going on for me to process it all. Im trying to print every position in the multidimensional array, I've done this before but haven't done it since my Java class last year, Please help public class Main { public static void main(String[] args) { int[][] matrix = { {8, 1, 6}, {3, 5, 7}, {4, 9, 0}, }; //output the numbers for(int arrRow=0;arrRow<=matrix[arrRow][arrPosition].length-1;arrRow++) { for(int arrPosition=0;arrPosition!=matrix[arrRow][arrPosition].length-1;arrPosition++) { System.out.println(matrix[arrRow][arrPosition]); } } } }