Validity check method not working

absolutely it won’t return false because the condition in both for loops 9 < j is always false it should be:

public static boolean validity(int array[][], int array2[][])
{
    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;
}

Browse More Popular Posts

Leave a Comment