java.lang · java.base · since Java 1.0

Long

declaration
public final class Long extends Number
        implements Comparable<Long>, Constable

Immutable box for long with parsing and comparison utilities. Same caching (−128…127) and same boxing pitfalls as Integer, at 64 bits.

Key methods

static long parseLong(String s)String → long.
static Long valueOf(long l)Boxing entry, small-value cache.
static int compare(long a, long b)Safe comparison.
static long parseUnsignedLong / divideUnsignedUnsigned interpretations of the same 64 bits.