Long

public final class Long extends Number
implements Comparable<Long>

The Long class wraps a value of the primitive type long in an object. An object of type Long contains a single field whose type is long.

In addition, this class provides several methods for converting a long to a String and a String to a long, as well as other constants and methods useful when dealing with a long.

Implementation note: The implementations of the "bit twiddling" methods (such as highestOneBit and numberOfTrailingZeros) are based on material from Henry S. Warren, Jr.'s Hacker's Delight, (Addison Wesley, 2002).

Constant Summary

int BYTES The number of bytes used to represent a long value in two's complement binary form.
long MAX_VALUE A constant holding the maximum value a long can have, 263-1.
long MIN_VALUE A constant holding the minimum value a long can have, -263.
int SIZE The number of bits used to represent a long value in two's complement binary form.

Field Summary

public static final Class<Long> TYPE The Class instance representing the primitive type long.

Public Constructor Summary

Long(long value)
Constructs a newly allocated Long object that represents the specified long argument.
Long(String s)
Constructs a newly allocated Long object that represents the long value indicated by the String parameter.

Public Method Summary

static int
bitCount(long i)
Returns the number of one-bits in the two's complement binary representation of the specified long value.
byte
byteValue()
Returns the value of this Long as a byte.
static int
compare(long x, long y)