The statements inside your source code file are generally executed from top to bottom, in the order in which they appear in the program source code. The Control flow statements, however, break the execution flow by employing decision-making, looping, and branching statements, enabling your program to execute particular blocks of code conditionally. This section describes the following statements supported by the Java programming language:
- Branching statements(if, if-else, switch)
- Looping statements (for, while, do-while)
- Jumping statements (break, continue, return)
Branching statements are used to select a block of code for execution depending upon certain conditions. These statements are also called selection statements. Java language provides two selection statements named if-else and switch-case. These statements are discussed in the next articles.