Java Literals

By Raul Rios

Types of Literals

Basically, a literal is the source code representation of a fixed value.
The source code representation of a literal is a string of characters. The characters in the string are the characters that make up the literal.

The following table shows the different types of literals.

Type of Literal

Description

Integer Literals

Integer literals are the most common type