Will the following code compile? If yes, what's the output of the following code?
class Test {
public static void main(String[] args) {
int[][] arr = {{1,2},{1,2,3,4}};
for(int[] i: arr) {
for(int ii: i)
System.out.print(ii + " ");
System.out.println();
}
}
}
1 2
1 2 3 4