当前位置: 代码迷 >> Eclipse >> 拆箱跟装箱
  详细解决方案

拆箱跟装箱

热度:67   发布时间:2016-04-22 23:56:01.0
拆箱和装箱
      Integer i = 100;
      i+=10;

视频上讲的时候是不报错的,为什么我运行就报错类型不匹配:不能从 int 转换为 Integer
------解决思路----------------------
我用1.8运行是不报错的。

package test;

class Main {
public static void main(String[] args) {
Integer i = 100;
i += 10;
}
}
  相关解决方案