Please take a look below for an example, I cannot understand the relationship between char and byte
byte b = 1; char c = 2; c = b;
Give me a compilation Error, because c is a type of char , and b is a type of byte , so in this state, you must cast
but now the twist is here when I run the code below
final byte b = 1; char c = 2; c = b;
line 2 compiles successfully, it doesnβt need casting at all so my question is why char c behave different when I use the final access modifier with byte
source share