Easier to check int[][]
int[][] arr = new int[size][2];
In this case, you need to allocate sizememory fragments of 16 bytes in size.
And in this case
int[][] arr = new int[2][size];
you need to allocate only 2 pieces of memory * 8 bytes in size.
And isolation is an expensive operation.
source
share