The condition in both the for loops are wrong, it must be
for(int j = 0; j < 9; j++)
for(int i=0; i < 9; i++)
if (array2[j][i] != array[j][i]&& array2[j][i] == 0)
return false;
return true;
solved Validity check method not working