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);
  }/*  www  .j a  v  a2  s  . co m*/
}

The code above generates the following result.





















Home »
  Java Tutorial »
    java.lang »




Boolean
Byte
Character
Class
Double
Enum
Float
Integer
Long
Math
Number
Object
Package
Process
ProcessBuilder
Runnable
Runtime
SecurityManager
Short
StackTraceElement
StrictMath
String
StringBuffer
StringBuilder
System
Thread
ThreadGroup
ThreadLocal
Throwable