Float intValue() method in Java with examples Last Updated : 26 Oct, 2018 Comments Improve Suggest changes Like Article Like Report 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 illustrate intValue() method in Java: Program 1: Java // Java code to demonstrate // Float intValue() 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); // intValue of the Float Object int output = b.intValue(); // printing the output System.out.println("Int value of " + b + " is : " + output); } } Output: Int value of 17.47 is : 17 Program 2: Java // Java code to demonstrate // Float intValue() method // Not a number class GFG { public static void main(String[] args) { // Float value Float a = Float.NaN; // wrapping the Float value // in the wrapper class Float Float b = new Float(a); // intValue of the Float Object int output = b.intValue(); // printing the output System.out.println("Int value of " + b + " is : " + output); } } Output: Int value of NaN is : 0 Reference: https://docs.oracle.com/javase/7/docs/api/java/lang/Float.html#intValue() Comment More infoAdvertise with us Next Article Float intValue() method in Java with examples G gopaldave Follow Improve Article Tags : Java java-basics Java-lang package Java-Functions Java-Float +1 More Practice Tags : Java Similar Reads Float isNaN() method in Java with examples The Float.isNaN() method in Float Class is a built in method in Java returns true if this Float value or the specified float value is Not-a-Number (NaN), or false otherwise. Syntax: public boolean isNaN() or public static boolean isNaN(float val) Parameters: he function accepts a single parameter va 2 min read Byte intValue() method in Java with examples The intValue() method of Byte class is a built in method in Java which is used to return the value of this Byte object as int. Syntax ByteObject.intValue() Return Value: It returns the value of ByteObject as int. Below is the implementation of intValue() method in Java: Example 1: Java // Java code 2 min read Level intValue() method in Java with Examples The intValue() method of java.util.logging.Level is used to get the integer value for this level object. Every level has an integer value associated with it. This integer value can be used for efficient ordering comparisons between Level objects. This method is helpful if we want to use the int valu 2 min read Number.intValue() method in java with examples The intValue() is an inbuilt method provided by the abstract class java.lang.Number. This method converts a numeric object, such as Float, Double, etc., to an int type. This method may involve rounding or truncation if the original number is a floating-point value.Syntax of Number.intValue() Methodp 2 min read Double intValue() method in Java with examples The intValue() method of Double class is a built in method to return the value specified by the calling object as int after type casting. Syntax: DoubleObject.intValue() Return Value: It return the value of DoubleObject as int. Below programs illustrate intValue() method in Java: Program 1: Java // 2 min read Like