3
「ショート30 = 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