Java – Double

Java – Double 2017-06-13T01:00:21+00:00

Double class :

The Double class encapsulates a double value. It defines several constants.

The largest and smallest values are saved in MAX_VALUE and MIN_VALUE.

The constant NaN (Not a Number) indicates that a value is not a number.

If you divide a double number by zero, the result is NaN. This class defines these constructors:

Double(double d)

Double(String str)

Here, d is a double value to be encapsulated in a Double object. In the last form, str is the string representation of a double value.

EX :


Output :
Object d1 = 6.876423654563E8
Object d2 = 686748.0
Minimum Value of Double = 4.9E-324
Maximum Value of Double = 1.7976931348623157E308
Byte value of Double = -3
int value of Double = 687642365
Float value of Double = 6.8764237E8
Double value from the string “765.89”=765.89

Prev Next