·int类型越界问题 public class HelloWorld { public static void main(String[] args) { int max = Integer.MAX_VALUE; System.out.println(max); System.out.println(max + 1); //越界的话会进入循环 System.out.println(max + 1L); //在一个常量之后加上一个L转成了long } }