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.
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:
Int value of 17.47 is : 17
Int value of NaN is : 0
Attention reader! Don’t stop learning now. Get hold of all the important Java Foundation and Collections concepts with the Fundamentals of Java and Java Collections Course at a student-friendly price and become industry ready. To complete your preparation from learning a language to DS Algo and many more, please refer Complete Interview Preparation Course.