Int I=9;//0 xfffffff7 decimal: 4294967287
Long l1=i& Integer. MAX_VALUE;//0 x7fff FFF7 decimal: 2147483639
In addition to the above this method just the sign bit, is not the original data into an unsigned number, misled many people, the correct method is:
Int I=9;
Long l1=long. The valueOf (Integer) toHexString (I). The toUpperCase (), 16);//0 xfffffff7 decimal: 4294967287
This method is the real unsigned integer value,
CodePudding user response:
Should the post rather than the postCodePudding user response: