This week's book giveaway is in the Mac OS forum. We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line! See this thread for details.
Pretending ints are 8-bit binary: 1 is 00000001 ~1 is 11111110 2 is 00000010 So if you add ~1 to 2 and ignore the overflow bit, you get 00000000. Since ~1 plus 2 is 0, ~1 must is a good way to represent -2, and is indeed how Java represents -2, except that ints are really 32 bits, not 8 bits.