Javatpoint Logo
Javatpoint Logo

Java Float longValue() Method

The longValue() method of Java Float class returns the value of this float object as a long after narrowing the primitive values or by casting to type long.

Syntax:

Parameters:

NA

Return Value:

The longValue() method returns the float value corresponding to this Float which has been converted to type long.

Example 1

Test it Now

Output:

1. Long value for 9655.0 = 9655
2. Long value for 9.996576E29 = 9223372036854775807
3. Long value for -8.6776988E10 = -86776987648
4. Long value for 3.4028235E38 = 9223372036854775807
5. Long value for 1.4E-45 = 0
7. Long value for 1.17549435E-38 = 0

Example 2

Test it Now

Output:

Enter three numbers
1.67.99
2.100.76
3.78.77
1.Sum:     67+100+78 = 245
1.Mul:     67*100*78 = 522600

Example 3

Test it Now

Output:

Enter your annual income
500000.6588
Your monthly income is:41666
You got an increment of 5000.
Your new salary is:46666

Next TopicJava Float





Youtube For Videos Join Our Youtube Channel: Join Now

Feedback


Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Preparation


Trending Technologies


B.Tech / MCA