posted 17 years ago
In the first case, the compies see that it is non-final. The value can change anytime during execution so it concludes that integer to byte conversion is not safe.
In the second case, as it is final, it sees that the value falls into the range of byte and the value can never change in its lifetime. Hence it compiles properly.