Page 2 of 2 FirstFirst 12
Results 21 to 29 of 29
  1. #21
    Chrizesu is offline Member
    Join Date
    Jan 2011
    Location
    Oregon
    Posts
    4
    Rep Power
    0

    Default

    If you're having trouble visualizing this in your mind, I found this website helpful: Multi-dimensional Arrays

    Another way that works up to 3 is think of it as a cube.

  2. #22
    funkygarzon is offline Senior Member
    Join Date
    Mar 2009
    Posts
    126
    Rep Power
    0

    Default

    Quote Originally Posted by Chrizesu View Post
    If you're having trouble visualizing this in your mind, I found this website helpful: Multi-dimensional Arrays

    Another way that works up to 3 is think of it as a cube.
    thank you Chrizesu , let me check that link and come .:)

  3. #23
    sunde887's Avatar
    sunde887 is offline Moderator
    Join Date
    Jan 2011
    Location
    Richmond, Virginia
    Posts
    3,069
    Blog Entries
    3
    Rep Power
    8

    Default

    Once you get to 3d arrays it's a bit harder to visualize, but like said above a cube helps, You could also think of it as an array of chessboards. where each element in the original array contains a chesbboard(if this example didn't work well for you, feel free to ignore it)

    but, each item in the array contains another multi-d array.

    so element 1 has a 4x5 array, so does 2 and 3

    Java Code:
    arr[0] = int[4][5];
    arr[1] = int[4][5];
    arr[2] = int[4][5];

  4. #24
    funkygarzon is offline Senior Member
    Join Date
    Mar 2009
    Posts
    126
    Rep Power
    0

    Default

    Quote Originally Posted by sunde887 View Post
    Once you get to 3d arrays it's a bit harder to visualize, but like said above a cube helps, You could also think of it as an array of chessboards. where each element in the original array contains a chesbboard(if this example didn't work well for you, feel free to ignore it)

    but, each item in the array contains another multi-d array.

    so element 1 has a 4x5 array, so does 2 and 3

    Java Code:
    arr[0] = int[4][5];
    arr[1] = int[4][5];
    arr[2] = int[4][5];

    first of all thanks for your effort to making this noob to understand sunde887 ,

    This 3d is really very tough to visualize buddy ,but as you said i am trying to visualize as a cube . ok let me try with the above example and please tell me whether i am correct or not ?

    I take this line "arr[0] = int[4][5];" from above example - does it mean index "0" has "4" element at right side and "5"

    elements towards it back side? :confused::confused::confused:
    Last edited by funkygarzon; 01-25-2011 at 06:21 PM.

  5. #25
    gcalvin is offline Senior Member
    Join Date
    Mar 2010
    Posts
    953
    Rep Power
    5

    Default

    I really think you're giving this whole topic much more time and attention than it deserves. Two-dimensional arrays are not unusual, but everything else that's been discussed in this thread is so rare that you really shouldn't spend any time worrying about it. When you see arrays in actual programs, they will make much more sense than trying to think about them in the abstract.

    -Gary-

  6. #26
    sunde887's Avatar
    sunde887 is offline Moderator
    Join Date
    Jan 2011
    Location
    Richmond, Virginia
    Posts
    3,069
    Blog Entries
    3
    Rep Power
    8

    Default

    yes, 3d arrays are pretty rate, element 0 though has a 2 d array with 3 elements, and each array element contains another array of 5 items.

    It's a bit hard to exactly explain it, but like said above I don't think you will run into them very often and you will get much more familiar with added dimensions in arrays as time goes on, Im still a beginner, but I cant think of many reasons to use a 3d array. When I first learned about multi dimension arrays i was pretty confused.

  7. #27
    funkygarzon is offline Senior Member
    Join Date
    Mar 2009
    Posts
    126
    Rep Power
    0

    Default

    Quote Originally Posted by gcalvin View Post
    I really think you're giving this whole topic much more time and attention than it deserves. Two-dimensional arrays are not unusual, but everything else that's been discussed in this thread is so rare that you really shouldn't spend any time worrying about it. When you see arrays in actual programs, they will make much more sense than trying to think about them in the abstract.

    -Gary-
    Quote Originally Posted by sunde887 View Post
    yes, 3d arrays are pretty rate, element 0 though has a 2 d array with 3 elements, and each array element contains another array of 5 items.

    It's a bit hard to exactly explain it, but like said above I don't think you will run into them very often and you will get much more familiar with added dimensions in arrays as time goes on, Im still a beginner, but I cant think of many reasons to use a 3d array. When I first learned about multi dimension arrays i was pretty confused.

    yes buddies :( , i can feel that i am wasting more time in this topic , but i have understood 2d clearly but 3d not so clearly only some what i understood ... but as you all said i think i will feel comfortable in future with this 3d , after finishing my core java :) ...

    Thank s a lot for all my friends who helped this noob ( me) making me to understand concept clearly , now i am in the topic called "operator" so if i had doubt i hope you all will help me like you all have did :) thanks . This forum rocks ..... i love this forum and got addicted to it o:o .. see you in the next topic guys ... :)

  8. #28
    sunde887's Avatar
    sunde887 is offline Moderator
    Join Date
    Jan 2011
    Location
    Richmond, Virginia
    Posts
    3,069
    Blog Entries
    3
    Rep Power
    8

    Default

    mark this thread solved if you are done (click thread tools and at the bottom you can choose "mark as solved")

  9. #29
    funkygarzon is offline Senior Member
    Join Date
    Mar 2009
    Posts
    126
    Rep Power
    0

    Default

    Quote Originally Posted by sunde887 View Post
    mark this thread solved if you are done (click thread tools and at the bottom you can choose "mark as solved")

    ooh for sure sunde887 , with pleasure ...thank you :):)

Page 2 of 2 FirstFirst 12

Similar Threads

  1. Mutliple JPanel's with an enhanced "for" loop
    By javaman1 in forum New To Java
    Replies: 4
    Last Post: 10-23-2010, 12:18 AM
  2. An "if" statement inside a "for" loop?
    By soccermiles in forum New To Java
    Replies: 18
    Last Post: 04-20-2010, 03:44 AM
  3. Replies: 2
    Last Post: 01-24-2009, 06:56 PM
  4. Replies: 1
    Last Post: 10-20-2008, 07:35 AM
  5. Replies: 3
    Last Post: 09-26-2008, 06:05 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •