Initialize a long in java

How do I initialize the long with the value 1000000000000000000 ? As it shows “The literal 1000000000000000000 of type int is out of range” error.

Hey Vishal,
Try putting L at the end of the number and see if it helps or not

1 Like