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 盐城小土包 阅读(194) 评论(0)  编辑  收藏 所属分类: J2EE

<2025年8月>
272829303112
3456789
10111213141516
17181920212223
24252627282930
31123456

导航

统计

常用链接

留言簿

随笔档案(14)

文章分类(18)

文章档案(18)

搜索

最新评论

阅读排行榜

评论排行榜