java.math · java.base · since Java 1.1

BigInteger

declaration
public class BigInteger extends Number implements Comparable<BigInteger>

Arbitrary-size integers: cryptography, combinatorics, ids beyond 64 bits. Immutable, operator-free arithmetic via methods.

Key methods

static BigInteger valueOf(long) / BigInteger(String val)Creation.
BigInteger add/multiply/pow/mod(…)Arithmetic.
static BigInteger probablePrime(int bitLength, Random rnd)Crypto-grade prime generation.