This has always bugged me so I'm bringing it to the community in the hopes that someone can help me. Let's say I have a 2D array such as
int[][] arr = new int[2][3];
I have never really been able to figure out how to think about this array. Is it a 2 x 3 or a 3 x 2 structure. I could write methods to print out both combinations.
Or another way to think about this is that a 2D array is simply an array of arrays. But is it an array of length 3 where each component is an array of length 2, or is it an array of length 2, where each component is an array of length 3.
Effectively, which dimension does the 2 refer to and which does the 3 refer to, or does it even matter?