3
为什么“短三十= 3 * 10”是合法的任务?
如果short自动升级为int算术运算,那么为什么是: short thirty = 10 * 3; 对short变量的合法赋值thirty? 反过来,这是: short ten = 10; short three = 3; short thirty = ten * three; // DOES NOT COMPILE AS EXPECTED 以及这个: int ten = 10; int three = 3; short thirty = ten * three; // DOES NOT COMPILE AS EXPECTED …
102
java
short
type-promotion