Expression
An expression is a piece of source code that produces a value at runtime.
Related concepts: EvaluationValue
Closest Wikipedia entry: Expression (computer science)
Misconceptions about Expression51 documented Misconceptions
Check YourselfArithmeticPlusPrecedes
Addition has higher precedence than string concatenation
AssignCompares
= compares two values
AssignmentNotExpression
An assignment a=b is not an expression
CannotChainMemberAccesses
Member accesses cannot be chained together
CannotChainMemberToConstructor
Method calls or field accesses cannot be chained to a constructor invocation
ChainedMethodsNotCalledFromOutside
Chained methods are all called on the object at the beginning of the chain
ComparisonWithBooleanLiteral
To test whether an expression is true or false, one must compare it to true or to false
CompositeExpressionsUntyped
Expressions that consist of multiple parts have no type
EqualityOperatorComparesObjectsValues
o==p compares the objects referred to by variables o and p
EqualsComparesReferences
o.equals(p) compares the references stored in the variables o and p
ExpressionAssigns
An expression that reads a variable also updates its value after the evaluation
ExpressionsDynamicallyTyped
One has to evaluate an expression to determine its type
LargeIntegerLong
Large integer numbers have type long
LiteralNoExpression
A literal is not an expression
MapToBooleanWithConditionalOperator
To map a boolean expression to a boolean, a conditional operator is necessary
NoAtomicExpression
Expressions must consist of more than one piece
NoShortCircuit
&& and || always evaluate both operands
ObjectsMustBeNamed
A variable is needed to instantiate an object
OutsideInMethodNesting
Nested method calls are invoked outside in
ParenthesesOnlyIfArgument
() are optional for method calls without arguments
RightToLeftChaining
Chained accesses are invoked from right to left
StringPlusStringifiesExpression
String concatenation stringifies non-String operand expressions
TargetTyping
The type of a numerical expression depends on the type expected by the surrounding context
ThisNoExpression
The name this is not an expression
VariablesHoldExpressions
= stores an expression in a variable