short a = 1;short b = 2;那么 a+b 是什么类型? 因为java里默认a+b是int类型,如果不进行强转成short就会报错。所以保留short类型的正确形式为short c; c=(short)(a+b);