DRAFT
LiteralNoExpression
Misconception:
A literal, on its own (like 1234567
), is not an expression.
Incorrect
A literal is not an expression
Correct
Even an individual literal is an expression
CorrectionHere is what's right.
Here is what's right.
A literal is the most basic form of expression. When looking at an expression as a tree, a literal is a leaf in such a tree.
Like every expression, a literal also has a type. The type of 1234567
is int
.
Language
Java