Since otherwise Java defaults to all numeric types assigned to Integer.
The only reason that "1L" is even allowed to be assigned to Long
(instead of the Long
primitive) is due to the "automatic boxing" introduced with Java 5.
Without β1Lβ, off-screen, it looks like this without βLβ:
Long myUserId = Integer.valueOf(1);
... which, I hope, obviously explains itself. :-)
source share