标签:integer gdi color pac public 构造 mat void math
1 package demo04; 2 3 import java.math.BigInteger; 4 5 //超过long型的整数, 封装成BigInteger类型的对象 6 public class BigIntegerDemo { 7 public static void main(String[] args) { 8 //构造方法 9 BigInteger b = new BigInteger("11111111111111111111111111111111111111111111"); 10 System.out.println(b); 11 12 BigInteger b1 = new BigInteger("111111111111111111111111"); 13 BigInteger b2 = new BigInteger("222222222222222222222222"); 14 15 //加 16 BigInteger bigadd = b1.add(b2); 17 System.out.println(bigadd); 18 19 //减 20 BigInteger bigsub = b2.subtract(b1); 21 System.out.println(bigsub); 22 23 //乘 24 BigInteger bigmul = b1.multiply(b2); 25 System.out.println(bigmul); 26 27 //除 28 BigInteger bigdiv = b2.divide(b1); 29 System.out.println(bigdiv); 30 31 } 32 }
标签:integer gdi color pac public 构造 mat void math
原文地址:http://www.cnblogs.com/lwn007/p/6880538.html