Bitwise operators let you test, set, clear and flip individual bits of an integer in O(1). Use them to pack many yes/no flags into one int, like file permissions, or to enumerate all subsets with a bitmask. XOR has the handy property that x ^ x is 0, which finds the single unpaired number in an array. In Java, watch the difference between >> and >>> on negative numbers.