This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
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:
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.