Java Double doubleValue() MethodThe doubleValue() method of Java Double class returns the double value of this Double object. SyntaxParametersNA Return valueThe doubleValue() method returns the double value represented by this object. Example 1Test it NowOutput: Result after being converted to double value = 22.8 Result after being converted to double value = 224.0 Example 2Test it NowOutput: 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
|