Hi,

you defined a 3-dimensional array at the left, but you assigned a 2-
dimensional array at the right.
You may change each of your numbers at the right into another array,
say:
        int[][][] num = {{{100, 101}, {100, 101}, {100, 101}},
            {{100, 101}, {100, 101}, {100, 101}},
            {{100, 101}, {100, 101}, {100, 101}}
        };
Of course, the numbers need not to be the same, I just did it with
copy'n paste.

hth, Rita

On Jul 29, 12:36 am, "tinyang" <[email protected]> wrote:
> Here is my result for exercise 2.  
>
> int[][][] num = {{ 1000, 1001, 1002},
>                          { 1003, 1004, 1005},
>                          { 1006, 1007, 1008}
>                          };
>
> The error I get is:
>
> Exception in thread "main" java.lang.RuntimeException: Uncompilable source
> code - incompatible types
>   required: int[]
>   found:    int
>         at Java3DimArray.main(Java3DimArray.java:21)
>
> I did Google for examples of initializing 3d arrays, but when I look at the
> example code, I can't figure out what is different about my code.  Can
> anyone see what I'm doing wrong?  Thanks!
>
> --
> :-)
> P Please don't print this e-mail unless you really need to.

--~--~---------~--~----~------------~-------~--~----~
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