"why does the declaration part of for loop is declared as int[] u, but not as int[][] u?"
The array is two-dimensional, so you are dealing with a double-layered iteration. You have an array "inside" another, in the same principle as List<List<Integer>> would work.
To iterate through all the elements, you should consider a rows-elements structure. It's necessary that you get each row from the container, and then each element from each row.
for(int[] u: uu) is simply a for-each iteration rows, with the same principle of for(int row = 0; row < container.length; row++), and u or respectively container[row] are not elements themselves, but rows (arrays) of elements. Meaning you require a second iteration layer to get the elements:
int[][] container = new int[10][10];
//... - Fill elements.
for(int row = 0; row < container.length; row++){
for(int element = 0; element < container[row].length; element++){
System.out.printf("Row: %d Element: %d Value: %d\n", row, element, container[row][element]);
}
}
2-D arrayin Java. Its anarray of array.array of arrayis a better term to name it. You will know it in future. :)