The return value of #2 can be determined at compile time, since you use a constant value. The compiler determines that expression 100 is assigment compatible with the return type of the method, then the compiler does an automatic narrowing conversion.
The other case (#3) is different. Becuase you explicitly return a variable of type integer. The value of the variable at run time cannot be determined by the compiler. Hance, automatic narrowing conversion cannot be applied.
Regards,
Edwin Dalorzo.
PS.
See the
Java Language Specification, look for "Assigment Conversion" in the second edition it is the 66 page.