public class Tabel {
private static int dimension;
private ArrayList<ArrayList<Character>> tabel;
public Tabel(int dimension) {
Tabel.dimension = dimension;
for (int i=0;i<Tabel.dimension*Tabel.dimension;i++) {
tabel.add(new ArrayList<Character>());
}
}
}
When I try to debug (eclipse ide) I get a lot of weird "errors" or at the very least I encounter something I consider unexpected.
The private static int does not appear in the "variables" section of debug.
I get a NullPointerException on tabel.add(...) but when I watch the debug, it enters the for once, does not add anything in the table because when I hit "next" instead of jumping to the closing braces it jumps out of the function.
If I comment the .add it works so that's the problem (I think). Is my syntax wrong ? or should I post more code ?
staticvariable that gets initialized by the constructor seems like a recipe for disaster.