posted 18 years ago
That's because "10" is a compile-time constant, assigned to a final var i, which becomes also a compile-time constant.
So, in this case, writing :
byte b = i;
is equivalent to :
byte b = 10;
(Compiler knows that 10 is in byte range, so does not complain.)
[ October 12, 2005: Message edited by: Seb Mathe ]
Regards,<br />Seb<br /> <br />SCJP 1.4