Hi All, 

 

i am having problems accessing and initialising a three dimensional array. 
Exercise is asking me to do the following:  

 

Declare and initialize 3-dimensional array of int 
Initialize each cell with increasing integer number starting from 1000, 1001, 
1002, and so on
 

This is what i have done so far :

 

 public static void main(String[] args) {
       

 int [][][]ages = new int [10][5][2];

     
       
    
      

        for (int i=0; i<10;i++){
            for (int j=0; j<5; j++){
                for (int k=0; k<2; k++){
                    System.out.println(ages);
                }
            }
        }

 

Though the output is wrong as you can see below : 

 

 

[...@3e25a5
[...@3e25a5
[...@3e25a5
[...@3e25a5
[...@3e25a5
[...@3e25a5
[...@3e25a5
[...@3e25a5
[...@3e25a5
[...@3e25a5
[...@3e25a5
[...@3e25a5
[...@3e25a5
[...@3e25a5
[...@3e25a5
[...@3e25a5
[...@3e25a5
[...@3e25a5
[...@3e25a5
[...@3e25a5
[...@3e25a5
[...@3e25a5
[...@3e25a5
[...@3e25a5
[...@3e25a5
[...@3e25a5
[...@3e25a5
[...@3e25a5
[...@3e25a5
[...@3e25a5
[...@3e25a5
[...@3e25a5
[...@3e25a5
[...@3e25a5
[...@3e25a5
[...@3e25a5
[...@3e25a5
[...@3e25a5
[...@3e25a5
[...@3e25a5
[...@3e25a5
[...@3e25a5
[...@3e25a5
[...@3e25a5
[...@3e25a5
[...@3e25a5
[...@3e25a5
[...@3e25a5
[...@3e25a5
[...@3e25a5
[...@3e25a5
[...@3e25a5
[...@3e25a5
[...@3e25a5
[...@3e25a5
[...@3e25a5
[...@3e25a5
[...@3e25a5
[...@3e25a5
[...@3e25a5
[...@3e25a5
[...@3e25a5
[...@3e25a5
[...@3e25a5
[...@3e25a5
[...@3e25a5
[...@3e25a5
[...@3e25a5
[...@3e25a5
[...@3e25a5
[...@3e25a5
[...@3e25a5
[...@3e25a5
[...@3e25a5
[...@3e25a5
[...@3e25a5
[...@3e25a5
[...@3e25a5
[...@3e25a5
[...@3e25a5
[...@3e25a5
[...@3e25a5
[...@3e25a5
[...@3e25a5
[...@3e25a5
[...@3e25a5
[...@3e25a5
[...@3e25a5
[...@3e25a5
[...@3e25a5
[...@3e25a5
[...@3e25a5
[...@3e25a5
[...@3e25a5
[...@3e25a5
[...@3e25a5
[...@3e25a5
[...@3e25a5
[...@3e25a5
[...@3e25a5
BUILD SUCCESSFUL (total time: 0 seconds)

 

Can someone please help me out ? 

 

Many Thanks 

 





                                          
_________________________________________________________________
Drag n’ drop—Get easy photo sharing with Windows Live™ Photos.

http://www.microsoft.com/windows/windowslive/products/photos.aspx
--~--~---------~--~----~------------~-------~--~----~
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