Thank you very much for the replies Rita and Nithin.  I learned from your
replies that my mistake was not adding the one more set of curly braces to
indicate a 3D array.  Your help is much appreciated!

  _____  

From: Nithin Rao [mailto:[email protected]] 
Sent: Wednesday, July 29, 2009 1:00 AM
To: [email protected]
Cc: [email protected]
Subject: Re: [java programming] 1036 - Ex. 2 arrays


Hi,
 
Try this,
 
int[][][] num = {  { { 1000, 1001, 1002},
                          { 1003, 1004, 1005},
                          { 1006, 1007, 1008}  }
                      };
Add two more braces (indicated in blue).
 
Hope this helps you.

On Wed, Jul 29, 2009 at 4:06 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. 
 
 





No virus found in this incoming message.
Checked by AVG - http://www.avg.com
Version: 8.0.169 / Virus Database: 270.13.24/2255 - Release Date: 7/28/2009
5:58 PM



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