1 Reply Latest reply: Dec 3, 2006 3:25 PM by 800329 RSS

    three dimensional array?

    807607
      hi,

      well i need an two dimensional which includes other two dimensional arrays at every position:

      as if i write array[0][0] then i access the first two dimensional array,
      by array[0][1] the second two dimensional array of the first row.

      I think it must be a four dimensional array, but i�m not for sure.
      If i am right, is this the right way to access the first element in the first row and second column of my two dimensional array, which i find in the second row and third colum of my "outer" two dimensional array?

      array[2][3][0][1]


      Thanks for answers.
        • 1. Re: three dimensional array?
          800329
          You will have to define a four-dimensional array to access it like you are going to do. E.g. int[][][][] array = new int[5][5][5][5] to have a 5x5x5x5 array. As I suspect you will have dynamic arrays, you should probably better use some List objects.
          int[][] is actually a definition of an array on int-arrays (from right to left). You could read it like (int[])[] where int[] is the type of the outer array.