Java Bitwise Operator
In computer, the bitwise
operators as their name suggests actually work on individual bits of integer
(int and long) values rather than working with bytes (or characters).
However in Java,
the bitwise and bit shift operators are used to manipulate the contents of
variables at a bit level according to binary format. These operators
perform bitwise and bit shift operations on integral type variables.
The bitwise operators are most
commonly used for testing and setting individual flag bits in a value.
In
order to understand their behavior, one must understand binary (base-2)
numbers and the 2?s-complement format used to represent negative integers.
You cannot use these operators with floating-point, array,
or object operands.
Read more at
http:/www.roseindia.net/java/master-java/bitwise-bitshift-operators.shtml