posted 15 years ago
Line 1 : byte a = 3;
Line 2 : a+= 7L;
The compiler automatically puts a cast in line 1. Will the second line run fine or will it require an explicit cast?
In case we require an explicit cast for long to byte (even though after the addition the value will easily fit into a byte), why don't we require an explicit cast in line 1 where also we are narrowing??
Please help me understand this.