Out of curiosity, how many dimensions of an array can you have in java.
I'm not aware of a restriction - as many as you need.
This seems to me to be a good time to be an experimentalist. Why don't you try it, find out what the answer is, and report it back? It's your first opportunity to give something back to the community.
In some ways, you should view every array is single-dimensional. A "multi-dimensional" array in Java such as string[][]
is really just an array where the element type is also an array.
I don't know of any limits as to how far that can go - "beyond what's sensible" I suspect. In other words, whatever limit there is, you're unlikely to ever run into it.
The Java language does not limit the number of dimensions, but the Java VM spec limits the number of dimensions to 255.
Proof of concept: http://www.ideone.com/vxkz3
(Ref: http://java.sun.com/docs/books/jvms/second_edition/html/ClassFile.doc.html#1221 "An array type descriptor is valid only if it represents 255 or fewer dimensions.")