In the first case, the code attempts to assign a char value to a byte variable. The char is a 16 bit unsigned type while byte is an 8 bit signed type. As you can imagine, there are a lot of char values that can not be represented by a variable of type byte.
The second code fragment is as follows.
final char c1 = 1; byte a = c1;
In the second case, the "final" modifier is added to the declaration of the char variable. As a result, the char variable is now a compile-time constant. The compiler recognizes that the constant value, 1, can be assigned to a variable of type byte.
This is covered in Section 5.2 of the Java Language Specification.
Dan Chisholm<br />SCJP 1.4<br /> <br /><a href="http://www.danchisholm.net/" target="_blank" rel="nofollow">Try my mock exam.</a>