A long declared without an L at the end is treated as an integer literal. Since yours it out of the range of integer, you must explicitly append an L to tell Java it's a long, declared as a long literal.