int a[][] ={{3,2,4,5},{1,2,3,4},{3,3,2,1,}};
//for
for (int i = 0; i < a.length; i++) {
for (int j = 0; j < a[i].length; j++) {
System.out.print(a[i][j]+" ");
}
System.out.println();
}
System.out.println("-------------------------------");
//foreach
for (int[] is : a) {
for (int i : is) {
System.out.print(i+" ");
}
System.out.println();
}