BigInteger & BigDicemal

import java.math.BigInteger;

public class HelloWorld {

    
public static void main(String[] args) {
        BigInteger bigI1 
= BigInteger.ONE;
        BigInteger bigI2 
= BigInteger.ONE;
        
        
// The operator + is undefined for the argument type(s) java.math.BigInteger
        
// BigInteger bigI3 = bigI1 + bigI2;
        BigInteger bigI4 = bigI1.add(bigI2);

        System.out.println(bigI1 
+ " " + bigI2 + " " + bigI4);
    }

}

// Expect Result: 1 1 2

posted on 2012-11-02 09:14 盐城小土包 阅读(189) 评论(0)  编辑  收藏 所属分类: J2EE

<2025年5月>
27282930123
45678910
11121314151617
18192021222324
25262728293031
1234567

导航

统计

常用链接

留言簿

随笔档案(14)

文章分类(18)

文章档案(18)

搜索

最新评论

阅读排行榜

评论排行榜