22.02 Control Flow
Control Flow
Overview
Control flow statements determine the execution path of a program.
Topics
- if-else Statements
- switch Statements
- Loops (for, while, do-while)
- break and continue
Examples
if (x > 0) {
System.out.println("Positive");
} else {
System.out.println("Negative");
}
for (int i = 0; i < 5; i++) {
System.out.println(i);
}