Java Control Flow: Boolean Logic, Conditionals, and Iteration Cheat Sheet
The core ideas of Java Control Flow: Boolean Logic, Conditionals, and Iteration distilled into a single, scannable reference — perfect for review or quick lookup.
Quick Reference
Boolean Expressions
Evaluate to true or false. Relational: ==, !=, <, >, <=, >=. Logical: && (and), || (or), ! (not).
if-else Statements
Conditional branching. if checks condition; else provides alternative. else-if chains multiple conditions.
for Loops
Repeats with init, condition, update. Executes body while condition true. Counter-controlled iteration.
while and do-while Loops
while checks condition before each iteration. do-while executes body at least once, checks after.
Short-Circuit Evaluation
&& stops if left is false. || stops if left is true. Prevents unnecessary evaluation.
De Morgan Laws
!(a&&b) equals !a||!b. !(a||b) equals !a&&!b. Flip operator and negate each operand.
Nested Conditionals and Loops
Placing if/loop inside another. Inner loop completes fully for each outer iteration.
Key Terms at a Glance
Get study tips in your inbox
We'll send you evidence-based study strategies and new cheat sheets as they're published.
We'll notify you about updates. No spam, unsubscribe anytime.