control-flow
4 tutorials tagged “control-flow”.
- Control Statements in JavaAn overview of how Java decides what to run next: decision statements (if, switch), loops (for, while, do-while) and jump statements (break, continue, return).
- Java If-Else StatementsMake decisions with if, if-else, the else-if ladder and nested if: how each form works, how the order of conditions matters, and the dangling-else trap.
- Switch StatementChoose between many fixed values with switch: case labels for int, char, String and enum, why break matters, fall-through and default.
- Switch ExpressionsThe modern switch that produces a value: arrow syntax, several labels per case, yield for multi-line cases, and exhaustiveness checks.