1. 程式人生 > >Java-數據越界奇異問題

Java-數據越界奇異問題

system integer pri sys nts eth exc catch print

public class yy {
public static void main(String[] args) {
// TODO Auto-generated method stub
System.out.println(2147483647*1000000);

System.out.println(Math.abs(Integer.valueOf("-2147483647")));
System.out.println(Math.abs(Integer.valueOf("-2147483648")));

System.out.println("result:"+1/2);
try {
System.out.println(Math.abs(Integer.valueOf("-2147483649")));
} catch (Exception e) {
e.printStackTrace();
}
}
}

Java-數據越界奇異問題