Maximum number of dimensions in a Java array
The Java language does not limit the number of dimensions, but the Java VM spec limits the number of dimensions to 255. For example, the following code will fail to compile: class Main { public static void main(String[] args) { final int[][][][][][][][][][][][][][][][] [][][][][][][][][][][][][][][][] [][][][][][][][][][][][][][][][] [][][][][][][][][][][][][][][][] [][][][][][][][][][][][][][][][] [][][][][][][][][][][][][][][][] [][][][][][][][][][][][][][][][] [][][][][][][][][][][][][][][][] [][][][][][][][][][][][][][][][] [][][][][][][][][][][][][][][][] [][][][][][][][][][][][][][][][] [][][][][][][][][][][][][][][][] [][][][][][][][][][][][][][][][] [][][][][][][][][][][][][][][][] … Read more