Constants value from Long class

TypeFieldSummary
static longMAX_VALUEMaximum value a long can have, 2^63-1.
static longMIN_VALUEMinimum value a long can have, -2^63.
static intSIZEThe number of bits used to represent a long value.
static Class<Long>TYPEThe 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.