22.02 Control Flow

Control Flow

Overview

Control flow statements determine the execution path of a program.

Topics

Examples

if (x > 0) {
    System.out.println("Positive");
} else {
    System.out.println("Negative");
}

for (int i = 0; i < 5; i++) {
    System.out.println(i);
}

Tags

#java #controlflow #loops #ifelse #switch #break #continue