Float floatValue() in Java with examples Last Updated : 19 Nov, 2020 Comments Improve Suggest changes Like Article Like Report 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 Java: Program 1: Java // Java code to demonstrate // Float floatValue() method class GFG { public static void main(String[] args) { // Float value Float a = 17.47f; // wrapping the Float value // in the wrapper class Float Float b = new Float(a); // floatValue of the Float Object float output = b.floatValue(); // prfloating the output System.out.println("Float value of " + b + " is : " + output); } } Output: Float value of 17.47 is : 17.47 Program 2: Java // Java code to demonstrate // Float floatValue() method class GFG { public static void main(String[] args) { String value = "54.1"; // wrapping the Float value // in the wrapper class Float Float b = new Float(value); // floatValue of the Float Object float output = b.floatValue(); // prfloating the output System.out.println("Float value of " + b + " is : " + output); } } Output: Float value of 54.1 is : 54.1 Reference: https://docs.oracle.com/javase/7/docs/api/java/lang/Float.html#floatValue() Comment More infoAdvertise with us Next Article Float floatValue() in Java with examples gopaldave Follow Improve Article Tags : Java java-basics Java-lang package Java-Functions Java-Float +1 More Practice Tags : Java Similar Reads Double floatValue() in Java with Examples 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 Impl 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 intValue() method in Java with examples The intValue() method in Float Class is a built in method in Java that returns the value specified by the calling object as int after type casting. Syntax: public int intValue() Parameters: The function accepts no parameter. Return Value: It return the value of FloatObject as int. Below programs ill 2 min read Number.floatValue() method in java with examples The floatValue() method is an inbuilt method in Java from the java.lang.Number class. This method is used when we want to extract the value of a Number object as a float data type. This may involve rounding or truncation, because this method returns the numeric value of the current object converted 2 min read Short floatValue() method in Java with Example The java.lang.Short.floatValue() method of Short class is a built in method in Java which is used to return the value of the Short object as a float. Syntax: public float floatValue() Return type: It return the value of ShortObject as float. Below is the implementation of floatValue() method in Java 2 min read Float floatToIntBits() method in Java with examples The floatToIntBits() method in Float Class is a built-in function in java that returns a representation of the specified floating-point value according to the IEEE 754 floating-point "single format" bit layout. Syntax: public static int floatToIntBits(float val) Parameter: The method accepts only on 2 min read Float floatToRawIntBits() method in Java with examples The floatToRawIntBits() method in Float Class is a built-in function in java that returns a representation of the specified floating-point value according to the IEEE 754 floating-point "single format" bit layout, preserving Not-a-Number (NaN) values. Syntax: public static int floatToRawIntBits(floa 2 min read Float hashCode() method in Java with examples The hashCode() method method in Float Class is a built-in method in Java that return the hashcode value of this Float object. Syntax: public int hashCode() Parameters: It takes no parameters. Returns: The function returns a hash code value for this object. Below is the implementation of hashCode() m 1 min read LongAdder floatValue() method in Java with Examples LongAdder class in Java creates a new adder with an initial sum of zero. The Java.LongAdder.floatValue() is an inbuilt method in java that returns the sum as a float value. When the object of the class is created its initial value is zero. Syntax: public float floatValue() Parameters: The function d 2 min read BigDecimal floatValue() Method in Java with Examples The java.math.BigDecimal.floatValue() converts this BigDecimal to a float. If this BigDecimal has too great magnitude to represent as a float, it will be converted to Float.NEGATIVE_INFINITY or Float.POSITIVE_INFINITY as appropriate. Note that even when the return value is finite, this conversion ca 2 min read Like