Java Float doubleValue() methodThe doubleValue() method of Java Float class returns a double value corresponding to this Float Object by widening the primitive values or in simple words by directly converting it to double via doubleValue() method . Syntax:Parameters:NA Return Value:This method returns the double value which has been converted from the float value of this object. Example 1Test it NowOutput: New value is = 55.05500030517578 Example 2Test it NowOutput: Float value = -5.55898E36 Double value = -5.558980006458046E36 Example 3Test it NowOutput: Error:(13, 22) java: float cannot be dereferenced Here double is a primitive data type its object can't be used to call the Float class method. If done so it will give the above error.
Next TopicJava Float
|