EvaluationResultsArePrinted
DRAFT

Misconception:

The effect of evaluating an expression is the same as the effect of printing the resulting value.

Incorrect

Evaluating an expression means outputting its result

Correct

Correction
Here is what's right.

Evaluating an expression (e.g., in a REPL like the BlueJ CodePad) leads to a value. That value is usually consumed by storing it in a variable (an assignment) or using it otherwise as operand in an enclosing expression. It is not printed per se.

Origin
Where could this misconception come from?

In a REPL one can type an expression, and it will evaluate it and print the resulting value. This does not happen when evaluating an expression somewhere within a program.

Language

Java

Concepts

Expressible In

Related Misconceptions

Stay up-to-date

Follow us on  twitter to hear about new misconceptions.