
can i know how can we intilize the three dimentional arrays in java? and how can we assign thae values to that array??

class ThreeDimensionalArray {
public static void main(String[]args){
int[][][] array = {{{1,2,3,4},{5,6,7,8}},{{10,20,30,40},{50,60,70,80}},{{30,20,10,50},{5,7,9,8}}};
for (int i = 0; i < array.length; i++) {
for (int j = 0; j < array[i].length; j++) {
for (int k = 0; k < array[i][j].length; k++) {
System.out.print(array[i][j][k]);
}
System.out.println();
}
System.out.println();
}
}
}
For more information, please go through the following link:
http://www.roseindia.net/java/java-conversion/three-dimensional-array-program.shtml
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.