Why during autoboxing final long to Byte compilation error happens, but final int to Byte is ok?

Viewed 569

There is no error during auto-boxing of constants with int and short types to Byte, but constant with long type do has error. Why?

final int i = 3;
Byte b = i; // no error

final short s = 3;
Byte b = s; // no error


final long l = 3;
Byte b = l; // error
1 Answers
Related