hi all,

the best way to think about Java Arrays is to think it is an array of arrayes

EX.

   int [][] arr = new int[3][4];
means that arr is an array of 3 items, each item is an array of 4
items  and so on
with this concept you can initialize arr like that
   int [][] arr = new int[3][];

   arr[0] = new int[5];
   arr[1] = new int[3];
   arr[2] = new int[7];

Hope I helped,
A.S.El-Dalatony.



On 1/21/09, mike quinn <[email protected]> wrote:
> Best way to envisage it is to think of a Excel spreadsheet document, you can
> have sheets with rows and columns but you can also have multiple sheets
> within an Excel document (or think of it like a cube with height, width and
> depth).
>
> But it is best not to think to much about the visualisation, how would you
> envisage 4, 5, 6... dimensions without your brain starting to hurt.
>
> On Wed, Jan 21, 2009 at 8:10 AM, sha <[email protected]> wrote:
>
>>
>> Hi,
>>
>> i have understood the one-dimensional array and the 2-dimensional
>> arrays... whereas my doubt is in 3-dimensional arrays.
>>
>> as in 2-dimensional arrays for example,  int [][] array1 = new int[3]
>> [4];
>>
>> the first index 3 indicates that there are 3 rows, whereas the second
>> index 4 indicated 4 columns. i.e. array1 is a 2-dimension array of
>> type int having 3-rows and 4-columns...
>>
>> wat would int[][][] array2 = new int[2][3][4] indicates??
>>
>> which is row and which is column?
>>
>> Thanks,
>> Sha
>>
>> >
>>
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/javaprogrammingwithpassion?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to