public class IntOuOfBounds {
public static void main(String[] args) {
int i = 2;
while (true) {
i *= Math.pow(2, i);
System.out.println(i);
}
}
}
输出结果如下
2147483647
2147483647
2147483647
2147483647
2147483647
2147483647
2147483647
2147483647
2147483647
2147483647
2147483647
....
到达上限值不再变化。2^32-1