array index out of bounds exception, AGAIN!
I am using this code, somewhere in the middle of a huge program.
Code:
else if(ev.getSource() == okButton1){
if(a<neigh1.s)a++;
for( int i=0; i<(810/30); i++) {
for( int j=0; j<(630/30); j++) {
rules[a-1][i][j]=exch3.rulbas[i][j];}}}
And I am getting an out_of_bounds exception. Is this command allowed? Where could my array possibly be going awry?
I have initialized them as follows:
Code:
public static int a=0;
public rule2 exch3;
public static int rules[][][]= new int[neigh1.s][810/30][630/30];
and
Code:
class rule2 implements Serializable {
public int rulbas[][];....etc