-2
int plate[8][8]={
           {0,1,0,1,0,1,0,1},
           {1,0,1,0,1,0,1,0},
           {0,1,0,1,0,1,0,1},
           {1,0,1,0,1,0,1,0},
           {0,1,0,1,0,1,0,1},
           {1,0,1,0,1,0,1,0},
           {0,1,0,1,0,1,0,1},
           {1,0,1,0,1,0,1,0},
           };

I want to initialize 2d array in java.How can alter this to make it right?
thank u.

AlexWei
  • 1,043
  • 2
  • 8
  • 32

1 Answers1

1

Change int plate[7][7] to int[][] plate or int plate[][]. Both are correct.

QBrute
  • 4,078
  • 6
  • 32
  • 38