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
  • Last Modified:

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
Asked:
nocturn4l
  • 5
  • 3
  • 2
2 Solutions
 
for_yanCommented:
Seems to b raesonable explanation
http://www.danzig.us/java_class/dimensions.html
0
 
for_yanCommented:
0
 
objectsCommented:
visually think of a cube
1d array = row
2d array = grid
3d array = cube
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
for_yanCommented:
You can think of them as cube or paraleleppiped divided in cells - analog to 2d- matirices
0
 
objectsCommented:
from a programatic viewport its just an extra dimension
its an array of 2d arrays
0
 
for_yanCommented:
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.
this is from my secomnd link - seesm undesratnadable

Open in new window

0
 
for_yanCommented:

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
 
objectsCommented:
> 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
 
nocturn4lAuthor 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
 
nocturn4lAuthor Commented:
ty
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

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