I was wondering why I get an issue with type Long..
Byte b = 127; //ok
Short s = 1000; //ok
Long l = 10; // not ok
So all i can figure is that all the literal values (127,1000 and 10) are of the primitive type int. In the case of Byte and Short, the compiler automatically checks the value and sees that the value can be assigned to the wrapper type, but why does it not work for Long?