1.9 Control of Flow
Introduction
Control-flow statements determine which parts of a program execute and how many times. Java provides conditional branching (`if`/`else`, `switch`) and loops (`for`, `while`, `do-while`) to move beyond simple top-to-bottom execution.
Key Concepts
Java Syntax
Code Examples
Each condition is checked in order; the first `true` branch runs and the rest are skipped. 84 satisfies `score >= 80` but not `score >= 90`, so it prints B.
The `for` loop runs a known number of times (1 through 3). The `while` loop checks its condition before each iteration and relies on `count++` to eventually make it false.