Home >Java >javaTutorial >Does Java support multidimensional arrays?

Does Java support multidimensional arrays?

王林
王林forward
2023-09-15 14:09:021109browse

Does Java support multidimensional arrays?

No, Java does not support multidimensional arrays.

  • Java supports arrays of arrays.
  • In Java, a two-dimensional array is nothing more than an array of one-dimensional arrays.

int[][] arr = new int[2][4];

  • Expression arr[i] Select a one-dimensional array, expression arr[i ][j] Selects elements from this array.
  • The array index for each dimension ranges from zero to "length". where length is the length of the array in the given dimensions.
  • There is no array assignment operator. Once an array is allocated, the number of dimensions and the size of each dimension are fixed.

The above is the detailed content of Does Java support multidimensional arrays?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:tutorialspoint.com. If there is any infringement, please contact admin@php.cn delete