Card 09/ 09

RecapDifficulty: Intermediate1 min

Recap: Operators

Types choose the job, three kinds of comparison, early stopping, grouping and increments, with where each was.

Java's operators come down to the five ideas below, each listed with the card that covers it.

What the topic established, and which card it was on
The ideaWhere
The operand types choose what a symbol doesOperators and Operand Types: One Symbol, Several Jobs
= assigns, == asks about identity, equals asks about contents= vs == vs equals in Java
&& and || stop early, which is what makes a null guard workShort-Circuit Evaluation with && and ||
*, / and % bind tighter than + and -Operator Precedence: Why 5 + 3 * 2 % 4 Is 7
i++ produces the old value; ++i produces the new onei++ vs ++i: Why j Is 5 After int j = i++

When an expression surprises you, look at the types and the grouping before you look at the operator. Both of those were decided by the compiler, and neither of them is visible in the line you read.