BigInteger big1 = new BigInteger("12345678901234567890");
BigInteger result = bigInt1.add(bigInt2);
// 更高效的方式 BigInteger smallNum = BigInteger.valueOf(12345L);
// 相对低效的方式 BigInteger smallNum = new BigInteger("12345");
你可能想看:
BigInteger big1 = new BigInteger("12345678901234567890");
BigInteger result = bigInt1.add(bigInt2);
// 更高效的方式 BigInteger smallNum = BigInteger.valueOf(12345L);
// 相对低效的方式 BigInteger smallNum = new BigInteger("12345");
文章已关闭评论!