-1

I write this code for solving Sudoku game and when I try to set data in function inside the array it will error, here is the code:

 public static boolean  CheckRowColumnBox(int data,int b,int[][] matrix,int r,int c){

     if(CheckRow( data, r, matrix ) 
     && CheckColumn(data, c, matrix) 
     && CheckBox(data, b, matrix,r,c)) {

        matrix[r][c]==data; //error here
        return true;
      }
        return false;
      }

why??? how can I solve it, where i can define r and c

Fullstack Guy
  • 16,368
  • 3
  • 29
  • 44

1 Answers1

0

Change matrix[r][c]==data; //error trigger here to matrix[r][c]=data; //no error here. Else put the first in a if statement block.

Remario
  • 3,813
  • 2
  • 18
  • 25
  • read this https://stackoverflow.com/questions/7520432/what-is-the-difference-between-vs-equals-in-java – Remario Sep 03 '18 at 14:50