Question: what is 2l in java?
Answer: How does 2L make it different? When you place 2L in code, that is a long literal, so the multiplications promote the other int s to long before multiplication, making your calculations correct by preventing overflow. The basic rules here to know here are: Java has operator precedence.