You never have anything returned as there isn't anything to return - both conditions are false.
Also I'm fairly sure it should be written as
if ((tail > distance) ^ ((story * 2) == tail)) {
System.out.println("a");
}
if ((distance + 1 != tail) ^ ((story * 2) == distance)) {
System.out.println("2");
}
You could also test it by saying
if ((tail > distance) ^ ((story * 2) == tail)) {
System.out.println("a");
} else {
System.out.println("Condition 1 False");
}
if ((distance + 1 != tail) ^ ((story * 2) == distance)) {
System.out.println("2");
} else {
System.out.println("condition 2 False");
}
Alternatively, did you mean to write
if ((tail > distance) || ((story * 2) == tail)) {
System.out.println("a");
}
if ((distance + 1 != tail) || ((story * 2) == distance)) {
System.out.println("2");
}
Using the logical OR instead?