~/ learn/ java-from-zero/ cards/ Primitive types & literals
1 of 4

Type a long literal with a suffix

Type a long literal with a suffix

Answer

long population = 8_000_000_000L;

A whole-number literal defaults to int; the L suffix makes it a long so it can hold values beyond int's ~2.1 billion range. Underscores are just visual grouping.

space flip · ← → navigate · esc to exit
NORMAL ~/memra/library/bf4a596f-f0da-4a21-bcba-f2e1f61f1721/flashcard utf-8 LF