Integer 类中的部分 “…unsigned…()” 函数结果尝试:
public class Main {
public static void main(String[] args) {
//4294967295 2^32-1
//2147483648 2^31
int a = Integer.divideUnsigned((int)2147483648L,2);
System.out.println("a=" + a); //a=1073741824而非负值
int c = Integer.compareUnsigned(-5,5);
System.out.println("c=" + c); //c=1 即"-5">5
int b = (int)2147483648L;
System.out.println("b=" + b); //b=-2147483648
int d = Integer.parseUnsignedInt("4294967295");
System.out.println("d=" + d); //d=-1 parseInt()会有NumberFormatException
String e = Integer.toUnsignedString((int)4294967295L);
System.out.println("e=" + e); //e=4294967295
}
}