Java 疑惑集之BigInteger篇

来源:互联网 发布:笨办法学python 百度 编辑:程序博客网 时间:2024/06/05 20:10

import java.math.*;
public class BigProblem {
 public static void main(String [] args){
  BigInteger b1=new BigInteger("5000");
  BigInteger b2=new BigInteger("50000");
  BigInteger b3=new BigInteger("500000");
  BigInteger total = BigInteger.ZERO;

  total.add(b1);
  total.add(b2);
  total.add(b3);
  System.out.println(total);
  }

}

输出是多少呢?b1,b2,b3的数到底add进去了吗?想必大家都会被BigInerger搞糊涂。