4.3. The Floating-Point Types

Floating-point numbers are represented by the float and double data types.

Table below lists the range of floating point values in Java.

			package javatutorial;

			/**
			 * Example class showing the range of floating point types
			 * 
			 * @author f5java.com
			 */

			public class FloatingPointRange {

				public static void main(String[] args) {
					
					float floatMinValue = Float.MIN_VALUE;
					float flaotMaxValue = Float.MAX_VALUE;
					
					double doubleMinValue = Double.MIN_VALUE;
					double doubleMaxValue = Double.MAX_VALUE;
					
					// Printing the floating point ranges
					System.out.println("Range of float values " + floatMinValue + " to " + flaotMaxValue);
					System.out.println("Range of double values " + doubleMinValue + " to " + doubleMaxValue);

				}

			}