In this section we will discuss Control Flow Statements in java 7. This is one type of Language Fundamentals.
Control Flow Statements in java 7
In this section we will discuss Control Flow Statements in java 7. This is one type of Language Fundamentals.
Control Flow Statements : -
In general program execution flow is from top to bottom but you can also control flow of your program with the help of control flow statements. This is done by using decisions-making, looping, and branching statements. So control flow statements break the flow of program and flow under some specific condition. These statements plays very important role in writing proper program.
We can divide control flow statements in the following sections -
- Decision-making Statements
- Looping Statements
- Branching Statements
Decision-making Statements :
This kind of control statements is used where you need to take any decision under certain conditions. We write some statements under that condition. Following are the statements which comes under Decision making-
- If statement
- switch statement
- conditional operator statement.
Looping Statements :
This kind of statements are used where you need to execute block of statements repeatedly. Following are three types of Looping statements -
- for loop
- Do-while loop
- while loop
Branching Statements :
Branching statements are categorize in the following types:
- break statement
- continue statement
- return statement