wat is the use of suffixing the letter L or l to a long integer number?
unless we suffix also it ll assign the number to long variable.
eg: long a = 10;
long a = 10L;
both are results same, then wat is the use of L with the number.
Printable View
wat is the use of suffixing the letter L or l to a long integer number?
unless we suffix also it ll assign the number to long variable.
eg: long a = 10;
long a = 10L;
both are results same, then wat is the use of L with the number.
In case of ambiguity you can tell the compiler that your number is a long number by appending an L or l. As you have already noticed it isn't necessary in many situations. Also, when the number doesn't fit in an int you have to tell the compiler explicitly that it's dealing with a long number, e.g. 9876543210L.
kind regards,
Jos