Home » Java Double doubleValue() Method with Examples

Java Double doubleValue() Method with Examples

by Online Tutorials Library

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

You may also like