import java.text.DecimalFormat; public class ThreeDArray { public static void main (String[] args) { int[][][] table = new int[3][4][5]; // Load the table with values for (int row=0; row < table.length; row++) for (int col=0; col < table[row].length; col++) for (int depth=0; depth < table[row][col].length; depth++) table[row][col][depth] = row*100 + col*10 + depth; // Print the table DecimalFormat fmt = new DecimalFormat("000"); for (int depth=0; depth < table[0][0].length; depth++) { System.out.println("======== Depth " + depth + " ========="); for (int row=0; row < table.length; row++) { for (int col=0; col < table[row].length; col++) System.out.print (fmt.format(table[row][col][depth]) + "\t"); System.out.println(); } } } }