3.10. Literals

A literal is the source code representation of a value of a primitive type (§4.2), the String type (§4.3.3), or the null type (§4.1).

Literal:    IntegerLiteral    FloatingPointLiteral    BooleanLiteral    CharacterLiteral    StringLiteral    NullLiteral

3.10.1. Integer Literals

An integer literal may be expressed in decimal (base 10), hexadecimal (base 16), octal (base 8), or binary (base 2).

IntegerLiteral:    DecimalIntegerLiteral    HexIntegerLiteral    OctalIntegerLiteral    BinaryIntegerLiteralDecimalIntegerLiteral:    DecimalNumeral IntegerTypeSuffixoptHexIntegerLiteral:    HexNumeral IntegerTypeSuffixoptOctalIntegerLiteral:    OctalNumeral IntegerTypeSuffixoptBinaryIntegerLiteral:    BinaryNumeral IntegerTypeSuffixopt

Get The Java® Language Specification, Java SE 7 Edition, Fourth Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.