亚洲国产日韩欧美一区二区三区,精品亚洲国产成人av在线,国产99视频精品免视看7,99国产精品久久久久久久成人热,欧美日韩亚洲国产综合乱

java-ee - eclipse編譯問題
大家講道理
大家講道理 2017-04-21 10:57:51
0
1
681

在myeclipse6.0編譯完全通過的代碼,在myeclipse10卻編譯報錯。使用的jdk都是自己安裝的jdk6.0(不是eclipse自帶的),編譯級別都是6.0.
代碼如下:
Long a = new Long(0);
a+=new Float("3.2");
在myeclipse10中提示的錯誤如下:
The operator += is undefined for the argument type(s) Long, float

誰知道是什么原因?。恐x謝了。

大家講道理
大家講道理

光陰似箭催人老,日月如移越少年。

reply all(1)
阿神

+= This operator is defined for basic types. The a and newFloat("3.2") you have here are both objects, so they cannot be calculated. Moreover, the classes under these two Number packages do not provide operation methods. If you want to do +3.2 operation on a, you need to:

Long a = new Long(0);
Float f = new Float("3.2");
long result = a.longValue() + f.longValue();
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template