No, Java does not support two or multi-dimensional arrays in the same way C and C++ do. In Java each row of a two-dimensional array is itself a one-dimensional array. Many programming languages directly support two dimensional arrays, but in Java a two dimensional array is an array of references to array objects. Because in Java a two-dimensional array is an array of one-dimensional arrays; therefore, rows of a seemingly two-dimensional array are allowed to vary in length.
A two-dimensional array variable is declared in exactly the same way as a one-dimensional array variable, except that there are two pairs of square brackets.
The following piece of code declares a two-dimensional array
twoDimArr of type
double  twoDimArr; twoDimArr = new double;
The first dimension specifies the number of rows, and the second dimension specifies the number of columns. To access an individual component of the
twoDimArr array we have to specify its position in form of row and column expressions. We place each expression in its own pair of brackets next to the name of the array. For example,
twoDimArr points to second element of the second row in the array.
Hope you have enjoyed reading about support of multi-dimensional arrays in Java. Please do write us your suggestions/comments to improve this page. Thanks for reading!
The latest flagship phones from Samsung feature bigger screens and a new kind of virtual assistant.Samsung Galaxy S8 - but is it art? The internet reactsPosted on Wednesday March 29, 2017
The experts and public respond to the newly unveiled Samsung Galaxy S8 and S8+ smartphones.Virgin Media overstated superfast broadband rolloutPosted on Wednesday March 29, 2017
Virgin Media suspends four employees after it emerged it overstated its superfast broadband rollout.Courtesy BBC News