A normal execution in java programming language happens in the top to bottom order and the statement within that code execution proceeds in the order by which they appear.
In java, we can control that flow of execution using certain statements. These statements are called control flow statements which ensure the smooth flow of execution based on the provided statements.
There are 3 types:
1. Decision Making Control Flow Statements
Depending upon the provided condition this flow works in such a way of the given condition is mostly comprised of boolean.
- if-else statement
- switch statement
2. Jump Control Flow Statements
Jumps out of a current flow of code execution when a certain condition is fulfilled and proceeds to the next step of the code.
- break statement
- continue statement
- return statement
3. Loop Control Flow Statements
To make repetitive iterations of looping certain code execution parts based on the provided condition.
- for loop
- for-each loop
- do-while loop
- while loop