Incorrect information about Integer literals,
February 12, 2010 at 10:07 PM
The L suffix is to generate a literal of type long, not of type int. Maybe that's what you intended to say, but it was not very clear, and the sentence "Integer literals is a sequence of digits and a suffix as L" is definitely incorrect. Please refer to the Java language specification, which provides a list of suffixes for literals of all types.
Just FYI, if you omit the suffix, you get a regular int, just like your "int month = 10;" example. There are no suffixes to indicate short and byte, however.
View All Comments