A long
can accommodate numbers as large as 263-1. But there's a trick to putting them into the primitive field.
If you're entering the primitive literal, then you have to add an L
at the end, as all numeric literals are treated as int
(and it can only go up to ~2.1 billion).
If you need numbers larger than that, use BigInteger
.