byte b=12;
b >>= 2; // Why is this legal? why does it automatically typecasts?
b = b >> 2; // Why is this illegal if the above is legal
b>>=2;
与b = (byte) (b>> 2);
15.26.2 复合赋值运算符 http://java.sun.com/docs/books/jls/third_edition/html/expressions.html#15.26.2
E1 op= E2 形式的复合赋值表达式是等效的
到 E1 = (T)((E1) op (E2)),其中 T 是 E1 的类型,除了 E1
仅评估一次。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)