Multiple choice technology programming languages

What is the result of the following operation? System.out.println(4 | 3);

  1. 6

  2. 0

  3. 1

  4. 7

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

The bitwise OR operator | evaluates 4 | 3. In binary, 4 is 100 and 3 is 011. Performing a bitwise OR yields 111 in binary, which equals 7 in decimal. The other values do not match the outcome of a bitwise OR operation.