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

Multidimensional associative arrays in Bash

You can’t do what you’re trying to do: bash arrays are one-dimensional $ declare -A PERSONS $ declare -A PERSON $ PERSON[“FNAME”]=’John’ $ PERSON[“LNAME”]=’Andrew’ $ declare -p PERSON declare -A PERSON='([FNAME]=”John” [LNAME]=”Andrew” )’ $ PERSONS[1]=([FNAME]=”John” [LNAME]=”Andrew” ) bash: PERSONS[1]: cannot assign list to array member You can fake multidimensionality by composing a suitable array index … Read more