DRAFT
EvaluationResultsArePrinted
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
CorrectionHere is what's right.
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.
OriginWhere could this misconception come from?
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