These are snippets of my code, but I keep getting the same error and I have no idea why.
I keep getting
Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: Index 2 out of bounds for length 2
at Grammar.(Grammar.java:92)
I can see that it has to do with the array size, maybe, but I have no idea where.
Thank you in advance if someone can help me, it would be greatly appreciated.
public int getInit() {
return init;
}
int max = 100;
int[][] ntr = new int[max][0];
NTR tempo = nttemp.remove(0); // NTR is another class that contains only gets
int tempoF = tempo.getFirst();
int tempoS = tempo.getSecond();
int i = 1;
92 ntr[tempo.getInit() - 'A'][i] = tempoF;
i++;
ntr[tempo.getInit() - 'A'][i] = tempoS;
i++;