支持无符号算术运算
Integer,Long
public static void main(String[] args) {
int a = 9;
int b = -3;
System.out.println(Integer.bitCount(a));
System.out.println(Integer.parseInt("10001", 2));
System.out.println(Integer.toUnsignedString(b));
System.out.println(Integer.toUnsignedString(b, 16));
System.out.println(Integer.parseUnsignedInt("3"));
System.out.println(Integer.parseUnsignedInt("256", 16));
System.out.println(Integer.divideUnsigned(-3, 9));
System.out.println(Integer.remainderUnsigned(-3, 9));
}
Byte,Short
public static void main(String[] args) {
byte b = -3;
System.out.println(Byte.toUnsignedInt(b));
System.out.println(Byte.toUnsignedLong(b));
short s = -3;
System.out.println(Short.toUnsignedInt(s));
System.out.println(Short.toUnsignedLong(s));
}