Problem with 3d array
Stephanie,2,10,10,10,10,10,10,10,10,10
so I use:
String[] steph1 = inFile.readLine().split(",");
now i want to organize the data in that array into its own 3d array as follows:
int names = 1;
int levels = 1;
int scores = 9;
String[][][] steph_1 = new String[names][levels][scores];
for(int name = 0; name < names; name++)
{
for(int i = 0; i < steph_1.length; i++)
steph_1[name][0][0] = steph1;
}
for(int level = 0; level < steph_1[0].length; level++)
{
for(int i = 1; i < steph_1[0].length; i++)
steph_1[0][level][0] = steph1;
}
for(int score = 0; score < steph_1[0][0].length; score++)
{
for(int i = 2; i < steph_1[0][0].length; i++)
steph_1[0][0][score] = steph1;
}
printDiver(steph_1);
public static void printDiver(String[][][] diver)
{
for(int x = 0; x < diver.length; x++)
{
for(int y = 0; y < diver[0].length; y++)
for(int z = 0; z < diver[0][0].length; z++)
System.out.println(diver[x][y][z]);
}
}
when I print the 3d array, however, I only get back the nine 10s stored in the array, i know it has to do with my 3 for loops, but i can't figure out where the problem is. Any help or suggestions would be appreciated.

