java.lang.Long floatValue()

Description

The floatValue() java method returns the value of this Long as a float after a widening primitive conversion.

Notes:

  • This method is specified by floatValue in class Number

Method Syntax

public float floatValue()

Method Argument

Data Type Parameter Description
N/A N/A N/A

Method Returns

The floatValue() method of Long class returns the numeric value represented by this object after conversion to type float.

Compatibility

Requires Java 1.0 and up

Java Long floatValue() Example

Below is a simple java example on the usage of floatValue() method of Long class.

Sample Output

Below is the sample output when you run the above example.

Java Long floatValue() example output

Suggested Reading List