A literal is an exact, specific value. When you see a number, or a string enclosed in quotes, those are literals.



The are called literals because you know exactly what the value is by looking at them. As opposed to variables, in which you don't necessarily know the value at any particular point in the program unless you check what has been stored there.

Note: Constants are not literals, even though you know the value stored there. A constant is still the name of a memory location where the literal value is stored.

A literal is not the name of a memory location - a literal is a specific value.