import java.math.BigInteger; /** * BigInteger Examples * * @author Dave * @version v100 * * Ref: https://www.geeksforgeeks.org/biginteger-class-in-java/ * */ public class bigint { public static void main(String args[]) { BigInteger b = new BigInteger("212343223434234342342342345"); BigInteger x = new BigInteger("0"); System.out.println("b = " + b); //Adding 1 to x; System.out.println("Before adding 1 to x = " + x); x = x.add(BigInteger.valueOf(1)); System.out.println("After adding 1 to x = " + x); //lots for examples on how to work with BigInteger at: //https://www.geeksforgeeks.org/biginteger-class-in-java/ } }