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
• Tim Cooke
• Devaka Cooray
• Ron McLeod
• Jeanne Boyarsky
Sheriffs:
• Liutauras Vilda
• paul wheaton
• Junilu Lacar
Saloon Keepers:
• Tim Moores
• Stephan van Hulst
• Piet Souris
• Carey Brown
• Tim Holloway
Bartenders:
• Martijn Verburg
• Frits Walraven
• Himai Minh

# Multidimensional Arrays

Greenhorn
Posts: 13
• Number of slices to send:
Optional 'thank-you' note:
Hello,
I am having a hard time wrapping my mind around the multidimensional array concept.

If I have an array declaration of:

double d[][][] = new double [3][][];

How would one explain best what this would hold?

Ranch Hand
Posts: 37
• Number of slices to send:
Optional 'thank-you' note:
take array as an object, therefore double[][][] is a reference type whose object holding reference variables to double[][], double[][] is a reference type whose object holding reference variables to double[]. You know how double[] works.

Greenhorn
Posts: 13
• Number of slices to send:
Optional 'thank-you' note:
double d[][][] = new double [3][][];

here d holds three double[][] arrays.

ex:
d[0]=a[][];
d[1]=b[][];
d[2]=c[][];

got it..

chaitanya.

Ranch Hand
Posts: 652
• Number of slices to send:
Optional 'thank-you' note:
Hi Brain,
This was discussed earlier. Refer to this LINK

Regards
NIK
SCJP 1.5

Brian Deer
Greenhorn
Posts: 13
• Number of slices to send:
Optional 'thank-you' note: