Mega Code Archive

 
Categories / Java Book / 001 Language Basics
 

0031 Bitwise Operators

Java bitwise operators can be applied to the integer types: long, int, short, char, byte. Bitwise Operators act upon the individual bits of their operands. Operator Result ~ Bitwise unary NOT & Bitwise AND | Bitwise OR ^ Bitwise exclusive OR >> Shift right >>> Shift right zero fill << Shift left &= Bitwise AND assignment |= Bitwise OR assignment ^= Bitwise exclusive OR assignment >>= Shift right assignment >>>= Shift right zero fill assignment <<= Shift left assignment