Home » Java Double floatValue() Method with Examples

Java Double floatValue() Method with Examples

by Online Tutorials Library

Java Double floatVlaue() method

The floatVlaue() method of Double class returns a float value of this double object.

Syntax

Parameters

NA

Return value

The floatValue() method returns the double value converted to type float .

Example 1

Test it Now

Output:

55.05587687687 after converted to float becomes : 55.055878  

Example 2

Test it Now

Output:

Double value = 9.87979878768757E19  Float value  = 9.879799E19  

Example 3

Test it Now

Output:

Error:(19, 24) java: double cannot be dereferenced  

Next TopicJava Double

You may also like