// Beware of code like this: b = a & 0xfff + 1; // Java treats this as: b = a & ( 0xfff + 1 ); // not b = ( a & 0xfff ) + 1; // which you likely intended