Why does:
public class Addition {
public static void main() {
int a = 0;
double b = 1.0;
a = a + b;
System.out.println(a);
}
}
not compile but:
public class Addition {
public static void main() {
int a = 0;
double b = 1.0;
a += b;
System.out.println(a);
}
}
compiles.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…