O'Reilly logo
  • Ahmed Gamal thinks this is interesting:

Beginners of Java often ask why we need to use the suffix l or L, because even without it, such as in the following, the program still compiles.

long a = 123;

This is only partly true. An integer literal without a suffix L or l is regarded as an int. Therefore, the following will generate a compile error because 9876543210 is larger than the capacity for an int:

From

Cover of Java: A Beginner’s Tutorial, 4th Edition (Updated for Java SE 8)

Note

The quistioin is not fully answered. why not to just use long a = 54613548; without adding l or L at the end?