Float shortValue() method in Java with examples Last Updated : 11 Jul, 2025 Summarize Comments Improve Suggest changes Share Like Article Like Report The shortValue() method in Float Class is a built-in method in Java which returns the value specified by calling the object as short after typecasting.Syntax: public short shortValue() Return Value: It return the value of FloatObject as short.Below programs illustrate shortValue() method in Java: Program 1: Java // Java code to demonstrate // Float shortValue() 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); // shortValue of the Float Object short output = b.shortValue(); // print shorting the output System.out.println("Short value of " + b + " is : " + output); } } Output: Short value of 17.47 is : 17 Program 2: Java // Java code to demonstrate // Float shortValue() method class GFG { public static void main(String[] args) { String value = "54.1f"; // wrapping the Float value // in the wrapper class Float Float b = new Float(value); // shortValue of the Float Object short output = b.shortValue(); // print shorting the output System.out.println("Short value of " + b + " is : " + output); } } Output: Short value of 54.1 is : 54 Reference: https://docs.oracle.com/javase/7/docs/api/java/lang/Float.html#shortValue() Comment More infoAdvertise with us Next Article Short floatValue() method in Java with Example G gopaldave Follow Improve Article Tags : Java java-basics Java-lang package Java-Functions Java-Float +1 More Practice Tags : Java Similar Reads 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 Number.shortValue() method in java with examples The shortValue() is an inbuilt method in Java from the java.lang.Number class. This method is used to convert the current number object into a short primitive type. This may involve rounding or truncation because the short data type in Java is a 16-bit signed integer with a value range from -32,768 2 min read Double shortValue() method in Java with examples The shortValue() method of Double class is a built in method to return the value specified by the calling object as short after type casting.Syntax: DoubleObject.shortValue() Return Value: It return the value of DoubleObject as short.Below programs illustrate shortValue() method in Java: Program 1: 2 min read Float parseFloat() method in Java with examples The parseFloat() method in Float Class is a built in method in Java that returns a new float initialized to the value represented by the specified String, as done by the valueOf method of class Float. Syntax: public static float parseFloat(String s) Parameters: It accepts a single mandatory paramete 2 min read Float longValue() in Java with Examples The java.lang.Float.longValue() method in Float Class is a built in method in Java that returns the value specified by the calling object as long after type casting. Syntax: public long longValue() Parameters: It takes no parameters. Return type: It returns an long value i.e. the type casted value o 1 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 Like