Java Double Example Program
Chapter:
Data Types
Last Updated:
28-03-2017 17:38:39 UTC
Program:
/* ............... START ............... */
public class JavaDoubleExample {
public static void main(String[] args) {
double d = 10.10;
Double dObj1 = new Double(d);
System.out.println(dObj1);
Double dObj3 = new Double("25.34");
System.out.println(dObj3);
}
}
/* ............... END ............... */
Output
Notes:
-
The double data type in java is a double-precision 64-bit IEEE 754 floating point.
- java.lang.Double class wraps a value of the primitive type double in an object.
- Double has a size of 8 bytes IEEE 754. Covers a range from 4.94065645841246544e-324d to 1.79769313486231570e+308d (positive or negative).
Tags
Java, Double