I have a strange problem which I can't fix:
A field:
private boolean[][][] gaps;
Constructor (1st line):
gaps = new boolean[NOBARRICADES][WIDTH][HEIGHT];
Constructor (2nd line):
for (int i = 0; i < NOBARRICADES; i++) {
Java throws an error for the 2nd line, saying:
Exception in thread "main"
java.lang.ArrayIndexOutOfBoundsException
Does it have anything to do with Java syntax (the mistake is in these lines of code) or I should look for the problem somewhere else?
NOBARRICADESis a constant int somewhere, it would be impossible for that for loop you posted to throw an exception, period. Can you post the actual code of what it's all doing?