May I also add that if the value is not within the range of the short (-32,768 to 32,767 (inclusive)) an explicit cast is required and that this value must be within the range of the int (-2,147,483,648 to 2,147,483,647 (inclusive)). Note that all literal values are integers UNLESS they are denoted as floats or doubles. See the following code snippet:
If you print s3, s5 and s6 the result will be -1.
Alex Theedom - Senior Java EE Developer (OCPJP/OCPJWCD)
It is true that the + operator returns integers even if the arguments are shorts and that you must cast the result to a short. However this only applies when the operation includes a variable. Like this:
However in the following two circumstances it is not required to cast to short:
Applies equally for all arithmetic operators (+, -, *, %, /) and byte, char and integers, but not floats or doubles.