posted 12 years ago
The JLS is the Java Language Specification.
It says (in the section that Henry referenced) that:
is equivalent to
It's this cast (implicit, because it's added automatically) that makes the difference. Any arithmetic operation between two integer types that are smaller than int results in an int. So a cast is needed to be able to assign it back to a byte.