floatValue(): This method is available in java.lang.Number class of Java.
Syntax:
float java.lang.Number.floatValue()
This method returns the value of the specified number as a float.
Parameters: NA
Returns: the numeric value represented by this object after conversion to type float.
Exceptions: NA
For Example
Number number = 1234
number.floatValue() = > It returns 1234.0
Approach
Java
public class NumberfloatValue {public static void main(String[] args) {Number number = 1234;System.out.println(number.floatValue());}}
Output:
1234.0
No comments:
Post a Comment