Java Double doubleValue() Method

The doubleValue() method of Java Double class returns the double value of this Double object.

Syntax

Parameters

NA

Return value

The doubleValue() method returns the double value represented by this object.

Example 1

Output:

Result after being converted to double value = 22.8
Result after being converted to double value = 224.0

Example 2

Output:

Error:(13, 83) java: double cannot be dereferenced

Double is a primitive data type. Its object cannot be used to call the Double class method. If you do so, it will give an error like above.