Header Ads

  • Breaking Now

    Does Java support multi dimensional arrays?

    The Java programming language does not really support multi-dimensional arrays. It does, however, support arrays of arrays. In Java, a two-dimensional array 'arr' is really an array of one-dimensional arrays:
    int[][] arr = new int[4][6];

    The expression arr[i] selects the one-dimensional array; the expression arr[i][j] selects the element from that array.
    The built-in multi-dimensional arrays suffer the same indignities that simple one-dimensional arrays do: Array indices in each dimension range from zero to , where length is the array length in the given dimension. There is no array assignment operator. The number of dimensions and the size of each dimension is fixed once the array has been allocated.

    Post Top Ad

    Post Bottom Ad