The floatValue() method of Double class is a built-in method to return the value specified by the calling object as float after typecasting.
Syntax:
DoubleObject.floatValue()
Return Type: It returns a float value i.e. the type casted value of the DoubleObject.
Example 1:
Java
class GFG {
public static void main(String[] args)
{
Double d = new Double(23);
float output = d.floatValue();
System.out.println(output);
}
}
|
Output:

Example 2:
Java
class GFG {
public static void main(String[] args)
{
Double d = new Double(-1023.15);
float output = d.floatValue();
System.out.println(output);
}
}
|
Output:
