Exception to Number Format Exception with “D” and “F”?

后端 未结 3 1841
不知归路
不知归路 2021-01-17 12:42

I have run into a very strange problem in my code. I have a simple temperature converter where the user enters the temperature in Celsius and, after pressing \"Convert\", th

3条回答
  •  独厮守ぢ
    2021-01-17 13:19

    Java interprets numbers like 123f as referring to a float and 123d as a double, whereas plain 123 means an int.

提交回复
热议问题