75 extended operator autochanger

When the char byte short variables involved in computing, calculates automatically converted to an int.

When * = = + / = - = when extended operator calculates the like, data type conversion automatically.

So: error.

short s = 1;
short s1 = 2;
short s2 = s+s1;

  

And: no error

short s = 1;
short s1 = 2;
s += s1;

  

Guess you like

Origin www.cnblogs.com/Scorpicat/p/12121417.html
75