Why is this 'if' statement printing "Impossible"? : <pre><code>public class Experiment5 {

private static int countChar(String string, char c) {
    int count = 0;
    for (int i = 0; i &lt; string.length(); i++) {
        if (string.charAt(i) == c) {
            count++;
        }
    }
    return count;
}

public static void main(String[] args) {
    Scanner scan = new Scanner(System.in);
    String input = scan.nextLine();

    if (countChar(input, '_') &gt; 0){
        if ((countChar(input, 'X') - countChar(input, '0') &gt;= 2) || (countChar(input, '0') - countChar(input, 'X') &gt;= 2) ) {
            System.out.println("Impossible");
            return;
        }
        System.out.println("Game not finished");
    }
}
</code></pre>

<p>Input:
<br>
XO_OOX_X_
<br>
<br>
I believe that the result should be "Game not finished" because the difference between the counts of 'X' and 'O' is 0.
<br>
 Then why is this returning "Impossible"?
<br>
<br>
Thank you for your help.</p>
