In Java, it is necessary to put a letter “L” after a numeric constant when it of type long.
Although Java permits a lower case “L” it is better to consistently use an upper case “L”, as the lowercase “L” can be easily confused with a numeric 1, when reading code.
For example, both variables x and y, are assigned the same value here, but can easily be read as having different values.

long x=10l; //watch out, this has a lower case "L" not a numeric 1 at the end.
long y=10L;



 


Write a comment

You need tologin.