O'Reilly logo

Programmer's Guide to Java™ Certification, A: A Comprehensive Primer, Second Edition by Rolf W. Rasmussen, Khalid A. Mughal

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

3.13. Integer Bitwise Operators: ~, &, |, ^

A review of number representation (see Section G.4, p. 598) is recommended before continuing with this section on how integer bitwise operators can be applied to values of integral data types.

Integer bitwise operators include the unary operator ~ (bitwise complement) and the binary operators & (bitwise AND), | (bitwise inclusive OR), and ^ (bitwise exclusive OR, a.k.a. bitwise XOR ).

The binary bitwise operators perform bitwise operations between corresponding individual bit values in the operands. Unary numeric promotion is applied to the operand of the unary bitwise complement operator ~, and binary numeric promotion is applied to the operands of the binary bitwise operators. The result is a new ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required