The problem is in the for loops. You are incrementing the row_length when you should be incrementing counterROW. The variable counterROW stays the same while what you are comparing it to keeps increasing.
On Jan 30, 3:50 pm, Stephen Adjei <[email protected]> wrote: > I run this code and it didnt print out anything but froze my machine: > why.does that mean home pc's cant process three D arrays > > public class Trial { > > public Trial() { > } > public static void main(String[] args){ > int row_length =4; > int col_length =3; > int ver_length =2; > > int SpacePoint[][][]= new int[row_length][col_length][ver_length]; > > for(int counterROW=0;counterROW<row_length;row_length++){ > for(int counterCOL=0;counterCOL<col_length;counterCOL++){ > for(int counterVer=0;counterVer<ver_length ; ver_length++){ > > SpacePoint[counterROW][counterCOL][counterVer]=counterROW+counterCOL+counterVer; > System.out.print(SpacePoint[counterROW][counterCOL][counterVer]); > > } > } > > } > > } > > I need some help on three dimensional array --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
