NoAtomicExpression
Observed

NoAtomicExpression
Incorrect

Expressions must consist of more than one piece

Correct

A single piece, like a literal or name, also is an expression

Correction
Here is what's right.

Even 1 is an expression. The same applies to a, or m(), or new Point(). There is no need for an operator. Of course an expression can involve operators, thus 1 + 3 or 1 + a are expressions, too.

Explain by Referring to the Definition

An expression is a piece of code that evaluates to a value. Anything that evaluates to a value is an expression. A single variable name also evaluates to a value, so does a method call (with a non-void return type), a constructor call, or even a literal (a value that stands for itself).

Explain with Expression Trees

The following tree represents the expression val + 1:

The entire tree, rooted in +, is an expression. Moreover, the subtree rooted in val, which consists of a single node, also is an expression. The same applies to the subtree rooted in 1, which represents the literal 1, which is an expression (that always evaluates to the value 1).

Language

Java

Concepts

Expressible In

Related Misconceptions

Other Languages

Literature References

The following papers directly or indirectly provide qualitative or quantitative evidence related to this misconception.

bevilacquaAssessingUnderstandingExpressions2024

Qualitative and quantitative systematic research

542 hand-drawn expression trees from 12 exams in 6 university courses

Java
Artifact

Diagram mistakes studied:
LiteralInlined: A literal is inlined into the parent node
41 / 447
Cases
VariableInlined: A simple variable access or field access is inlined into the parent node
83 / 346
Cases
TargetInlined: The target (expression before dot) has been inlined (e.g., into a method invocation or a field access with explicit targets).
97 / 303
Cases
IndexInlined: The index in an array access expression has been inlined.
25 / 79
Cases
LiteralWithoutType: A literal is missing the type annotation.
25 / 406
Cases
VariableWithoutType: A simple variable access is missing the type annotation.
14 / 322
Cases
LiteralWithoutValue: A literal is missing the value annotation.
61 / 159
Cases
VariableWithoutValue: A simple variable access is missing the value annotation.
17 / 115
Cases
chiodiniSurveyingUpperSecondaryTeachers2025

Quantitative systematic research

97 Swiss high school teachers and their students

Python
Artifact

Programming Language Misconceptions studied:
NAE: NoAtomicExpression
39 / 97
Teachers hold misconception
42 / 97
Teachers familiar with misconception
Important: 18
Somewhat Important: 25
Not So Important: 26
Not Important: 18
I'm not sure: 10
Importance (reported by teachers)
Frequently: 8
Multiple Times: 16
At Least Once: 9
Never: 40
I don't know: 24
Prevalence in students (reported by teachers)