Multiple choice technology programming languages

What will happen when you attempt to compile and run the following code? int Output = 10; boolean b1 = false; if((b1 == true) && ((Output += 10) == 20)) { System.out.println("We are equal " + Output); } else { System.out.println("Not equal! " + Output); }

  1. Compilation and output of "Not equal! 10".

  2. Compilation and output of "Not equal! 20".

  3. Compilation and output of "We are equal 10".

  4. Compilation error, attempting to perform binary comparison on logical data type.

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

The condition uses the short-circuit logical AND operator &&. Since b1 == true evaluates to false, the second operand ((Output += 10) == 20) is never executed. Consequently, Output remains 10, and the program enters the else block, printing "Not equal! 10".