Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
• Status: Solved
• Priority: Medium
• Security: Public
• Views: 1066

# Java Triple Array (ex: int[][][] s)- Can someone explain to me how this works?

I understand what an array is.. and what a matrix is too.. but if you add a third array in there i'm quite confused on how it works.

Row and Column are pretty much self explanatory.. but I don't think it becomes a 3d array with a third?  Because technically it's all just a big 1-D array ?

Can someone explain this to me in laymans terms?  Or link me to something that explains this?  I tried searching google without much success.  Thanks
0
nocturn4l
• 5
• 3
• 2
2 Solutions

Commented:
Seems to b raesonable explanation
http://www.danzig.us/java_class/dimensions.html
0

Commented:
0

Commented:
visually think of a cube
1d array = row
2d array = grid
3d array = cube
0

Commented:
You can think of them as cube or paraleleppiped divided in cells - analog to 2d- matirices
0

Commented:
from a programatic viewport its just an extra dimension
its an array of 2d arrays
0

Commented:
``````Three-dimensional arrays are treated similarly. For example, a three-dimensional array of ints could be created with the declaration statement "int[][][] B = new int[7][5][11];". It's possible to visualize the value of B as a solid 7-by-5-by-11 block of cells. Each cell holds an int and represents one position in the three-dimensional array. Individual positions in the array can be referred with variable names of the form B[i][j][k]. Higher-dimensional arrays follow the same pattern, although for dimensions greater than three, there is no easy way to visualize the structure of the array.
``````
0

Commented:

This has a good illustration of initilization of three-dimensional array:
http://www.velocityreviews.com/forums/t140287-3-d-arrays.html
Not so easy to understand, but still
0

Commented:
> Because technically it's all just a big 1-D array ?

no, its an array of 2d arrays
ie. its an array of (array of arrays) :)
0

Author Commented:
thanks for the links and explanations guys.. reading em right now to see if i can get a better understanding.  will give points when i'm done (in the middle of a project so might be a while)... i want to leave this open just incase i have some questions, thanks!
0

Author Commented:
ty
0

## Featured Post

• 5
• 3
• 2
Tackle projects and never again get stuck behind a technical roadblock.