In the below code:
final int a;
a=2;
byte b=a; // error: possible loss of precision
Why do I get this error? Isn't a
final variable compile time constant expression and hence implicitly narrowed to byte during the assignment?
In other words isn't the above code equivalent to:
final int a=2;
byte b=a;