intanInt=1;doubleaDouble=2.5;anInt=anInt+aDouble;//Error-needtocastdoubletointanInt+=aDouble;//Thisisok.Why?anInt=aDouble;//Thisisalsoanerror.anInt=1+aDouble;//Thisisalsoanerror.所以我的问题是:为什么执行anInt+=aDouble不是编译错误? 最佳答案 四种情况中的三种正确报告错误。复合赋值是该规则的唯一异常(exception)。Java语言规范第15