Initialize double array java with enum value -
I have a little problem, I hope you can help me:
I have The class in Java is called TOKEN and inside it is:
< P> In the other category (the same package) I am trying to create a matrix of arrays with columns and rows, and I am trying to get it started from "class" to second class with "value": < / P>public enum TOKEN {EMPTY, WHITE, BLACK}
NR, and NC are low and values (for example 6,7) But when I try to run the code, it prevents here (before moving) board [a] [b] = token Empty; Can someone help me? Thanks! public class boards {private int line; Private int column; Private token [] [] Board; Public board (int nr, int nc) {this.row = nr; This.column = NC; For (int a = 0; a; l> line; a ++) {for (int b = 0; b
You must first initialize the array:
board = new Token [nr] [nc];
Comments
Post a Comment