So I just learned doing arrays in 1D and 2D in java, but I don't seem to do 3D correct since the output seems to show null like this:
One null null
null Two null
null null ThreeOne null null
null Two null
null null ThreeOne null null
null Two null
null null Three
I want it like this:
One Two Three
One Two Three
One Two ThreeOne Two Three
One Two Three
One Two ThreeOne Two Three
One Two Three
One Two Three
SOLVED (changed the format of the array to make it simplier for me as a beginner.)
public class Main {
public static void main(String[] args)
{
String[][][] numbers = {
{{"One", "Two", "Three"}, {"Four", "Five", "Six"},
{"Seven", "Eight", "Nine"}, {"Ten", "Eleven", "Twelve"}}
};
for(int i = 0; i < numbers.length; i++)
{
System.out.println();
for(int j = 0; j < numbers[i].length; j++)
{
System.out.println();
for(int k = 0; k < numbers[i][j].length; k++)
{
System.out.print(numbers[i][j][k] + " ");
}
}
}
}
}