Skip to content

Integer Literal

IsaacShelton edited this page Mar 21, 2022 · 1 revision

Integer Literal

Integer literals are integer values of an unspecified type.

Example 1

1000

Example 2

-8476

Example 3

0

Type Determination

The type of the integer literal is determined by the context around the literal. If the value is used alongside a value of a known integer type, then the integer literal will become that type, otherwise it will collapse to be of type long by default.

Clone this wiki locally