public class t {
public static void main(String[] args) {
short s1 = 1;
s1 = (short) (s1 + 1);//如果是s1=s1+1; 编译会报错
short s2 = 1;
s2 += 1;
}
}
经过反编译后
short s1 = 1;
s1 = (short) (s1 + 1);
short s2 = 1;
s2 =(short)(s2 + 1);
public class t {
public static void main(String[] args) {
short s1 = 1;
s1 = (short) (s1 + 1);//如果是s1=s1+1; 编译会报错
short s2 = 1;
s2 += 1;
}
}
经过反编译后
short s1 = 1;
s1 = (short) (s1 + 1);
short s2 = 1;
s2 =(short)(s2 + 1);