Calls debugging

Report a typo

Using the debugger, determine which branch of the if statement in the main function is executed by the program. Then, figure out with which argument values the program calls the printXor function.

class Main {
    public static void main(String[] args) {
        int condition1 = 175892;
        int condition2 = 98795;

        if ((condition1 & condition2) > 35925) {
            printXor(condition1 - condition2, condition1 | condition2); // 1
        } else {
            printXor(condition1 ^ condition2, condition1 & condition2); // 2
        }
    }

    static void printXor(int condition1, int condition2) {
        System.out.println(condition1 ^ condition2);
    }
}

Enter the answer as 3 numbers separated by one space character in the following order: <branch number> <condition1 argument value> <condition2 argument value>.

Enter a short text

Create a free account to access the full topic