Double floatValue() in Java with Examples Last Updated : 14 Apr, 2022 Comments Improve Suggest changes Like Article Like Report 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 // Java Program to Implement floatValue() Method // of Double Class // Class class GFG { // Main driver method public static void main(String[] args) { // Creating a Double object Double d = new Double(23); // Typecasting the value using // floatValue() method of Double class float output = d.floatValue(); // Printing the double value on console System.out.println(output); } } Output: Example 2: Java // Java Program to Implement floatValue() Method // of Double Class // Class class GFG { // Main driver method public static void main(String[] args) { // Taking a double value by // creating object of Double class Double d = new Double(-1023.15); // Typecasting the value using // floatValue() method of Double class float output = d.floatValue(); // Printing the above double value System.out.println(output); } } Output: Comment More infoAdvertise with us Next Article Double floatValue() in Java with Examples S ShivamKD Follow Improve Article Tags : Java Java-Library Java-lang package Practice Tags : Java Similar Reads DoubleAdder floatValue() method in Java with Examples The java.DoubleAdder.floatValue() is an inbuilt method in java that returns the sum() as an float after a narrowing primitive conversion. When the object of the class is created its initial value is zero. Syntax: public float floatValue() Parameters: This method does not accepts any parameter. Retur 1 min read Byte floatValue() method in Java with examples The floatValue() method of Byte class is a built in method in Java which is used to return the value of this Byte object as float. Syntax ByteObject.floatValue() Return Value: It return the value of ByteObject as float. Below is the implementation of floatValue() method in Java: Example 1: Java // J 2 min read Float floatValue() in Java with examples The floatValue() method in Float Class is a built-in function in java that returns the value specified by the calling object as float after type casting. Syntax: public float floatValue() Return Value: It returns the value of FloatObject as float. Below programs illustrate floatValue() method in Jav 2 min read DoubleAccumulator floatValue() method in Java with Examples The Java.DoubleAccumulator.floatValue() is an inbuilt method in java that returns the current value as an float after a narrowing primitive conversion. It means the initial datatype is double which is explicitly converted into type float. Syntax: public float floatValue() Parameters: The function do 2 min read Float doubleValue() method in Java with examples The doubleValue() method of Float class is a built in method to return the value specified by the calling object as double after type casting. Syntax: FloatObject.doubleValue() Return Value: It return the double value of this Float object. Below programs illustrate doubleValue() method in Java: Prog 2 min read Like