a+=b 默认有个强制类型转换!和a=a+b是不一样的
public class Demo2 {
public static void main(String[] args) {
int a=1;
float b=1.1f;
System.out.println("b+=a:"+(b+=a));
System.out.println("a+=b:"+(a+=b));
}
}
public class Demo2 {
public static void main(String[] args) {
int a=1;
float b=1.1f;
System.out.println("b+=a:"+(b+=a));
System.out.println("a+=b:"+(a+=b));
}
}