Javatpoint Logo
Javatpoint Logo

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

Test it Now

Output:

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

Example 2

Test it Now

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.


Next TopicJava Double





Youtube For Videos Join Our Youtube Channel: Join Now

Feedback


Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Preparation


Trending Technologies


B.Tech / MCA