Never thought I would ever ask a question like this, but this
OCAJP 8 drives me mad, from time to time. Here goes:
According to the JLS, 5.2:
A narrowing primitive conversion may be used if the type of the variable is byte, short, or char, and the value of the constant expression is representable in the type of the variable.
Now, given that, why do I get the following results. The book I have seems to take this for granted (one of the well known OCAJP books)
Thanks!
Edit: good heavens. The line just before the quoted line is:
In addition, if the expression is a constant expression (§15.28) of type
byte, short, char, or int:
Missed that... sorry about it.