双 a = a + int b 和 int a += 双 b 有什么区别?
2022-09-01 11:39:51
为什么:
public class Addition {
public static void main() {
int a = 0;
double b = 1.0;
a = a + b;
System.out.println(a);
}
}
不是编译,而是:
public class Addition {
public static void main() {
int a = 0;
double b = 1.0;
a += b;
System.out.println(a);
}
}
编译。