short foo = 0;
short bar = 1;
foo = foo + bar; Although foo and bar are short, foo + bar gives an int
Although it is possible to convert between the two types used, Java needs to be told that you want to do it. The program could be rewritten like this:
short foo = 0; short bar = 1; foo = (short)(foo + bar);