Get the minimum and maximum value of a primitive data types : Data Type Introduction « Data Type « Java Tutorial






public class Main {
  public static void main(String[] args) {
    System.out.println("Byte.MIN = " + Byte.MIN_VALUE);
    System.out.println("Byte.MAX = " + Byte.MAX_VALUE);
    System.out.println("Short.MIN = " + Short.MIN_VALUE);
    System.out.println("Short.MAX = " + Short.MAX_VALUE);
    System.out.println("Integer.MIN = " + Integer.MIN_VALUE);
    System.out.println("Integer.MAX = " + Integer.MAX_VALUE);
    System.out.println("Long.MIN = " + Long.MIN_VALUE);
    System.out.println("Long.MAX = " + Long.MAX_VALUE);
    System.out.println("Float.MIN = " + Float.MIN_VALUE);
    System.out.println("Float.MAX = " + Float.MAX_VALUE);
    System.out.println("Double.MIN = " + Double.MIN_VALUE);
    System.out.println("Double.MAX = " + Double.MAX_VALUE);
  }
}








2.1.Data Type Introduction
2.1.1.The Primitive Types
2.1.2.Size for Java's Primitive Types
2.1.3.Default values for primitives and references
2.1.4.Literals
2.1.5.Surprise! Java lets you overflow
2.1.6.Wrapping a Primitive Type in a Wrapper Object: boolean, byte, char, short, int, long, float, double
2.1.7.Print the limits of primitive types (e.g. byte, short, int ...) in Java
2.1.8.Get the minimum and maximum value of a primitive data types
2.1.9.Shows default initial values
2.1.10.Primitive utilities
2.1.11.Return primitive type the passed in wrapper type corresponds to