Problem with my double subscript array Java Applet

Status
You're currently viewing only TheJet's posts. Click here to go back to viewing the entire thread.
Not open for further replies.

TheJet

Ars Praefectus
4,598
Subscriptor++
Also, I think that building the array as "int array[][] = new int[5][4];" and then referencing it as array[5][anything] will give you an array bounds exception, since (as stated above) your valid indices are only 0-4 and 0-3 respectively. (again IIRC, but I may be getting Java mixed up with C here). For a 6x5 array, you really want to declare it that way, i.e. "int array[][] = new int[6][5]" which will give you 0-5 and 0-4 respectively.

TheJet
 
Status
You're currently viewing only TheJet's posts. Click here to go back to viewing the entire thread.
Not open for further replies.