• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Array

 
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
how can i think about multi-dimension array?
 
Ranch Hand
Posts: 82
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Think of it as an array where each element contains (that is, has a reference to) another array, which has to be the same type as the first one (but can be null). This other array can also "contain" different arrays, and so on.
Does this help?
Andris
P.S. If an array A refers to arrays B, C, D..., then B, C, D don't have to be of the same length.
 
Sheriff
Posts: 11343
Mac Safari Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
A multidimensional array is just an array of arrays of arrays... So take it one array at a time. I tend to envision an array as a filing cabinet. In a multidimensional array, each drawer simply contains another filing cabinet.

See this thread for an illustration...

https://coderanch.com/t/247423/java-programmer-SCJP/certification/Arrays-these-guys-think-they
 
Ranch Hand
Posts: 3852
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
guy belpa ..
i am sending you an image of multi dimentional array on your yahoo mail ...
that i got from Ramy M. Camel ... rally helping guy ...
thanks to him ...
[ January 13, 2005: Message edited by: rathi ji ]
 
ankur rathi
Ranch Hand
Posts: 3852
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
That diagram is for :
byte b[][][][] = new byte[2][3][1][2];

hope it will help ...
reply
    Bookmark Topic Watch Topic
  • New Topic