In this section, we will learn to convert a float type data into an integer.
In this program, first of all we declare a float variable named 'f'. Which is stored the value '10.0F'. Here the is the '10.0F' is used for representing the float type number. If the F can't be applied at the end of the value, the result has been a double and it is not a float.
For converting the float type value into an integer, we simply applied the type casting process and get the integer value.
Here is the code of this program:
Output this program.
| C:\corejava>java FloatToInt
Rs. 20,000 US$ 300
Today: Rs. 10,000 US$150
Course Duration: 30 hrs
Posted on: July 4, 2007 If you enjoyed this post then why not add us on Google+? Add us to your Circles