Type | Field | Summary |
---|---|---|
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. |
static Class<Long> | TYPE | The Class instance representing the primitive type long. |
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
java2s.com | Contact Us | Privacy Policy |
Copyright 2009 - 12 Demo Source and Support. All rights reserved. |
All other trademarks are property of their respective owners. |