Card 09/ 09
All 9 cards
RecapDifficulty: Intermediate1 min
Which Operator Asked Which Question
Five things this topic established, and where each one was.
| The thing | Where |
|---|---|
| The operand types choose what a symbol does | One Symbol, Several Jobs |
= assigns, == asks about identity, .equals asks about contents | Assigning, Comparing Identity, and Comparing Contents |
&& and || stop early, which is what makes a null guard work | Short-Circuiting, and the Null Check That Leans On It |
*, / and % bind tighter than + and - | Why 5 + 3 * 2 % 4 Is Not Read Left to Right |
i++ produces the old value; ++i produces the new one | 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.