Winston Gutkowski wrote:
fred rosenberger wrote:just to be pedantic...No, you are not.
Java does not have multi-dimensional arrays. Java only had one dimensional arrays, but they can hold just about anything...including arrays.
Just to be complete here, Fred is absolutely right, BUT the language also offers:
(a) Semantics to initialize a 3D (or almost any-D) matrix in a single statement.
(b) The ability to access a particular cell in an any-D matrix directly by the use of indexes.
However, (b) requires (a); so if you don't set up your matrix in a single statement, you may well run into trouble.
Also, generic values (such as length) should still be accessed the way they're intended (ie, as the property of a basic array).
fred rosenberger wrote:System.out.println() is your best friend. I would stick some in just before line 65, so you have something like this:
i suppose you could print height and width before entering the loop on line 60, which would reduce the noise a little.
John Jai wrote:Welcome to Javaranch, Johnny.
Yes the issue in the for loop. Note that array indices start from  to [array's length - 1]. So the char [height][width][depth] array can hold char to char [height-1][width-1][depth-1] items (since index starts from 0).
Since you are not looping from 0 to length - 1, but directly try to assign to array's length, dimensions[height][width] you receive the ArrayIndexOutOfBoundsException.
I shall move the thread to Beginning Java forum.