java.lang.NumberFormatException: Expected an int but was 0.6 at line 1 column 8454

假装没事ソ 提交于 2019-12-03 06:10:51

Try using a float or double instead of an int; 0.6 is not an integer, it is a decimal. Note that java automatically interprets decimals as doubles; an example of a float would be 0.6f.

That's because the parser is expecting an int whereas the actual value it got was float. What you can do is, change that value's type from int to float in your model.

This might cause problems in your code wherever you are using that value. You can solve it by casting that float value to an integer.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!