【发布时间】:2012-09-21 17:13:05
【问题描述】:
我明天要考试,我看不懂我的书的解释,感谢帮助:
public class TestClass{
public static void main(String[] args) throws Exception{
int a = Integer.MIN_VALUE;
int b = -a;
System.out.println( a+ " "+b);
}
}
输出:-2147483648 -2147483648
为什么这会打印 2 个大小相同的负数而不是正数和负数?
【问题讨论】:
标签: java variables integer negative-number