posted 13 years ago
Thanks for the example.
Here's a sample that shows where I am still confused.
When I declare and initialize the array as (line 14):
int[][][] scores3 = { {1,2,3}, {4,5,6}, {7,8,9} };
The compile complains as follows:
ArrayTest.java:16: incompatible types
found : int
required: int[]
int[][][] scores3 = { {1,2,3}, {4,5,6}, {7,8,9} };
^
ArrayTest.java:16: incompatible types
found : int
required: int[]
int[][][] scores3 = { {1,2,3}, {4,5,6}, {7,8,9} };
.
.
. ^
9 errors
When I declare without the initialization I can use "int[][][]" but why am I not able to use "int[][][]" when I declare and initialize the array?
This only seems to be an issue with three dimensional arrays.
Thanks for the help.