• 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

Multi-dimensional array

 
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

Can someone please explain how the following code works? Thanks.

 
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
String[][][] arr ={

{ { "a", "b", "c"}#arr[0][0]#, {"d", "e", null}#arr[0][1]# }, //arr[0][][]
{ {"x"}#arr[1][0]#, null }, //arr[1][][]
{ {"y"}#arr[2][0]#}, //arr[2][][]
{ { "z", "p"}#arr[3][0]#, {}#arr[3][1]# } //arr[3][][]


};


To get �y� -> String test = arr[2][0][0];
To get �null� ->String test1 = arr[0][1][2];

[ July 15, 2005: Message edited by: Marcos Vilela ]
[ July 15, 2005: Message edited by: Marcos Vilela ]
 
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
Think of this in terms of array of arrays.
 
reply
    Bookmark Topic Watch Topic
  • New Topic