O'Reilly logo

The Java® Language Specification, Java SE 7 Edition, Fourth Edition by Alex Buckley, Gilad Bracha, Guy Steele, Bill Joy, James Gosling

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required