+ 1

What is the use of float in Java program.

5th Mar 2018, 8:32 AM
Nijnam Dwivedi
3 Respostas
+ 13
In Java, when you type a decimal number as 3.6, its interpreted as a double. doubleis a 64-bit precision IEEE 754 floating point, while floatis a 32-bit precision IEEE 754 floating point. As a float is less precise than a double, the conversion cannot be performed implicitly. If you want to create a float, you should end your number with f (i.e.: 3.6f). float a = 3.6f; check out this link 👇 https://stackoverflow.com/questions/5076710/what-is-float-in-java
5th Mar 2018, 8:54 AM
🌛DT🌜
🌛DT🌜 - avatar
+ 12
https://www.sololearn.com/Discuss/660920/?ref=app
5th Mar 2018, 9:44 AM
Gaurav Agrawal
Gaurav Agrawal - avatar
+ 2
For decimal numbers that more than one number after the point, we use Double, if not, then Float is sufficient.
5th Mar 2018, 10:26 AM
Aaron Stone
Aaron Stone - avatar