Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
java
java
assert (1 << 2) == 4         // bitwise left shift
assert (4 >> 1) == 2         // bitwise right shift
assert (15 >>> 1) == 7       // bitwise unsigned right shift
assert (3 | 6) == 7          // bitwise or
assert (3 & 6) == 2          // bitwise and
assert (3 ^ 6) == 5          // bitwise xor
int mostlyonesmostlyOnes = 0xFFFFFFFE
assert ~mostlyones~mostlyOnes == 1      // bitwise negation