~/ learn/ java-from-zero/ cards/ Variables, Types & Operators
1 of 22

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/8fa37489-d406-4464-b339-c068afe9014a/flashcard utf-8 LF