my dog learned polymorphism*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Multidimensional Arrays Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Multidimensional Arrays" Watch "Multidimensional Arrays" New topic
Author

Multidimensional Arrays

Brian Deer
Greenhorn

Joined: Jan 30, 2007
Posts: 13
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?
Yeming Hu
Ranch Hand

Joined: May 14, 2007
Posts: 37
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.


Best Wishes,<br /> Yeming
chaitanya gopal
Greenhorn

Joined: May 22, 2007
Posts: 13
double d[][][] = new double [3][][];

here d holds three double[][] arrays.

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

got it..

chaitanya.
Nik Arora
Ranch Hand

Joined: Apr 26, 2007
Posts: 652
Hi Brain,
This was discussed earlier. Refer to this LINK




Regards
NIK
SCJP 1.5
Brian Deer
Greenhorn

Joined: Jan 30, 2007
Posts: 13
Very helpful. thank you!!!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Multidimensional Arrays