Java Control Flow of Statements
Categories: Core Java
There are three main categories of control flow statements:
- Selection Statements:Selection statement allows the program to choose any one path from different set of paths of execution.
- if Statement
- if-else Statement
- Nested if-else Statement
- if-else-if Statement
- switch case Statement
- Loop/Iteration Statements:Looping is a process by which we can repeat a single statement or a group of statements n number of times.
- for Loop
- while Loop
- do-while Loop
- for each Loop
- Transfer/Jump Statements:Jump statements can be used to modify the behavior of conditional and iterative statements. Jump statements allow you to exit a loop, start the next iteration of a loop, or explicitly transfer program control to a specified location in your program.
- break
- continue
- Labeled break
- Labeled continue
- return