I made a little test to manipulate a short
and I came across a compilation problem.
The following code compile :
short s = 1;
s += s;
while this one doesn't :
short s = 1;
s = s + s; //Cannot convert from int to short
I've read that shorts
are automatically promoted to int
, but what's the difference between those two codes ?