So I have a problem where Java is telling me that the following line is an illegal start of expression and not a statement and ‘;’ expected, etc…
The expression is:
Random rand = new Random();
int[][] coords = new int[24][2];
start = rand.nextInt(16);
coords[0][0]={0,start};
What’s wrong with that expression?
In
coords[0][0]={0,start};,{0, start}is simply not a valid expression. It looks like you’re trying to initialize the first row of the array, in which case you’re looking for something along these lines: