Arrays of More Than Two Dimensions


You can create arrays of any dimension you want (within reason) by using the proper number of square brackets in the array creation expression. For instance, to declare a 3-D integer array you might type

 int myArray[][][] = new int[3][4][5]; 

A 3-D array is treated as an array of 2-D arrays, a 4-D array is treated as an array of 3-D arrays, and so on.



Technical Java. Applications for Science and Engineering
Technical Java: Applications for Science and Engineering
ISBN: 0131018159
EAN: 2147483647
Year: 2003
Pages: 281
Authors: Grant Palmer

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net