Java Data Type Tutorial - Java Float.floatValue()








Syntax

Float.floatValue() has the following syntax.

public float floatValue()

Example

In the following code shows how to use Float.floatValue() method.

public class Main {
  public static void main(String[] args) {
    Float floatObject = new Float("10.01");
    float b = floatObject.floatValue();
    System.out.println("float:"+b);
  }
}

The code above generates the following result.