+ 1
Float vs. Double
Can a value be at the same time double and float? Explain please I thought 14.55 was either double or float depending on the programmer's choice
2 Answers
+ 6
A decimal point value is always by default a double. You need to declare it as float for it be a float.
+ 1
You can add "f" if you want to prevent it from being a double by default:
5.4f //float
5.4 //double