集册 Java实例教程 测试整数溢出

测试整数溢出

欢马劈雪     最近更新时间:2020-01-02 10:19:05

473
提示:您可在线编辑运行本教程的实例 - 运行实例,去试试!
测试整数溢出

public class Main {
/** 
来 自 
N o w J a v a . c o m
**/

  public static void main(String[] args) {

    int a = 1000000000;

    System.out.println(a);

    a += 1000000000;

    System.out.println(a);

    a += 1000000000;

    System.out.println(a);

    a += 1000000000;

    System.out.println(a);

  }


}