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






Get the minimum and maximum value of a primitive data types?

    
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);
  }
}

 

   
    
    
    
  








Related examples in the same category

1.Cast a float or double to an integral valueCast a float or double to an integral value
2.A simple casting demo
3.Casting Demo
4.Class with methods for type conversion
5.Data type conversion
6.Data type Conversion Util
7.Convert Byte array to Int
8.Convert Number To Target Class
9.Convert byte array to Long
10.Convert long to Bytes
11.Conversion utilities
12.Get Time From Date
13.Get String From Date
14.A method used to build a date for use Marker XML and KML data
15.A method used to build a date for display in line with existing formatting rules