I am not sure if my logic works, as I already change x to x+1 in my for loop condition.
In addition, why I can only put it in the main body but I can't put this piece of code:
multiArray[0] = new int [0];
multiArray[1] = new int [1];
multiArray[2] = new int [2];
multiArray[3] = new int [3];
below this code:
public static int[][] multiArray = new int[4][];
This is what happens:
What it says is that:
Exception in thread "main" java.lang.Error: Unresolved compilation problem and syntax error on token "void", record expected
Btw, it suddenly pops out squiggly red lines on 'void' and syntax errors like add class body after';'.
I am really stuck, thank you.