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?
You shouldn't use a lowercase L. It looks too much like a one, and will confuse people. Use an uppercase L instead: 10L. It does the same but is less confusing.