-
Coding issue
My professor gave us this program as an example to compile in class. I can't get it to compile. I get the following error in Dr. Java 2 errors found:
File: /home/matt/Checkerboard.java [line: 3]
Error: Syntax error on token "8", delete this token
File: /home/matt/Checkerboard.java [line: 3]
Error: Syntax error on token "8", delete this token
Code:
public class Checkerboard{
public static void main(String[] args){
char a [8][8];
for (i=0;i<8;i++);
{
for (j=0;j<8;j++)
System.out.print(a[i][j]);
System.out.println("");
}
}
}
-
You don't declare arrays like that in java, that is c++ type style. Try looking up how to use a constructor and the new keyword to declare and initialize an array properly.
-