+ 3
for multi dimensional array u need to have 2 loops running ! for better understanding draw matrix put some value & den try to write the code
+ 2
//You can use enhanced for loop like this:
public class Program {
public static void main(String[] args) {
int [][][] sample = { { {1, 2, 3}, {4, 5, 6} }, {{19, 20, 21}}};
for(int[][] i: sample){
for(int[] j: i){
for(int k: j){
System.out.print(k);
}
System.out.println();
}
System.out.print("");
}
}
}