Code:
- import java.math.*;
- public class BigInt {
- public static void main(String[] args) {
- String s1 = new String(“1234567898765432100000”);
- String s2 = new String(“1234567899999999999999”);
- BigInteger bigX = new BigInteger(s1);
- BigInteger bigY = new BigInteger(s2);
- BigInteger bigXY = bigX.multiply(bigY);
- System.out.println(s1+” x “+s2+” = “+bigXY);
- }
- }
更详细信息应该查看java api中,java.math.BigInteger;