摘要: 精度小于int的数值运算的时候都回被自动转换为int后进行计算 所以,下面的代码会报编译错误 short s1 = 1;short s2 = 1;s1= (s1+s2); 必须改成: short s1 = 1;short s2 = 1;s1= (short)(s1+s2); 但是,s1+=4;是正确 阅读全文
posted @ 2020-03-15 20:55 厦门哈韩 阅读(351) 评论(0) 推荐(0)