The literal xyz of type int is out of range

Add a capital L to the end:

long value = 9223372036854775807L;

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

Leave a Comment