The literal @@@@ of type int is out of range

When I tried to assign a variable of long data type with the following in java

long x = 1429278000000;

I got the following compilation error

"The literal 1429278000000 of type int is out of range"

I got it resolved by adding capital L to the end.
long x = 1429278000000L;

Otherwise, the compiler will try to parse the literal as an int

No comments:

 Python Basics How to check the version of Python interpreter mac terminal

Popular in last 30 days