Was macht ein bitweises exklusives ODER in Java?

Gegeben:

public class Spock {
    public static void main(String[] args) {
        Long tail = 2000L;
        Long distance = 1999L;
        Long story = 1000L;
        if ((tail > distance) ^ ((story * 2) == tail)) {
            System.out.print("1");
        }
        if ((distance + 1 != tail) ^ ((story * 2) == distance)) {
            System.out.print("2");
        }
    }
}

Warum gibt dieser Beispielcode nichts aus?

Antworten auf die Frage(4)

Ihre Antwort auf die Frage