my constructor is
public class Figure{
int[][] x;
Color y;
public Figure(int[][] x , Color y){
this.x=x;
this.y=y;
}
and i am initializing object in the following way:
Figure s = new Figure({{0,1,1},{1,1,0}},Color.ORANGE);
getting the following error:
Type mismatch – cannot convert from int[][] to Figure
Syntax error on tokens: misplaced construct
Variable declarator expected instead
You have to create the matrix like this:
Or a less dirty way: spread the matrix construction over a couple of lines: