Constants value from Long class
static long MAX_VALUE
- Maximum value a long can have, 2^63-1.
static long MIN_VALUE
- Minimum value a long can have, -2^63.
static int SIZE
- The number of bits used to represent a long value.
The following code displays the max/min value of a long type
public class Main {
public static void main(String[] args) {
System.out.println(Long.MAX_VALUE);
System.out.println(Long.MIN_VALUE);
System.out.println(Long.SIZE);
}
}
The output:
9223372036854775807
-9223372036854775808
64
Home
Java Book
Essential Classes
Java Book
Essential Classes
Long:
- Long class
- Constants value from Long class
- Constructors from Long
- Convert long value to byte, double, float, int, long, short
- Decode a string to create long value
- Get the long value from a system property
- Compare two long values
- Parse long value from string
- Convert long value to binary, hex and octal format strings
- Convert long value to string
- Get the sign of the long value
- Get the number of zero bits preceding and following
- Reverse and rotate a long value