Bitwise operations

Text books

If you want to learn more about Bitwise operator in Java and Programming in general, read the book Hackers Delight by Henry S. Warren. Its the bible to learn about bitwise and bitshift operation and revered by expert programmers.

bitwise operator

An operator that manipulates the bits of one or more of its operands individually and in parallel. Examples include the binary logical operators (&, |, ^), the binary shift operators (<<, >>, >>>) and the unary one’s complement operator (~).

REMEMBER : wherever possible, always prefer bit manipulation to other techniques.

Bitwise operations and Logical operations using XOR