Possible Duplicate:
Integer summing blues, short += short problem
I have summarized my problem into following code snippet.I have two short vaiable and I am adding these two variable into another short variable,but I am getting compile time error.Why is it so?
1.short x = 1, y = 1;
2.short z = x + y;
Compile time error at line 2
EDIT:
If short+short=int
then why int+int !=long
By specification
short + short -> int. Doshort z = (short)(x + y);Best answer is given by Eric Lippert here: Integer summing blues, short += short problem