public class Tweedledum {
public static void main(String[] args) {
// Put your declarations for x and i here
short x = 0;
int i = 1;
x += i; // Must be LEGAL
System.out.println(x);
x = x + i; // Must be ILLEGAL
}
public static void main(String[] args) {
// Put your declarations for x and i here
short x = 0;
int i = 1;
x += i; // Must be LEGAL
System.out.println(x);
x = x + i; // Must be ILLEGAL
}
}
1,复合表达式自动地将所执行计算的结果转型为其左侧变量的类型