Java Control Flow Statements | Programming Fundamentals | G C Reddy |

preview_player
Показать описание
Control Flow Statements in Java

We have three types of conditional statements in computer programming.

1. Decision-making/Conditional statements (if, switch)
2. Loop Statements (for, while, do while, and enhanced for)
3. Branching statements (break, continue, and return)

Decision Making Statements in Java:

In Java, we have the following decision-making statements –

1. Java if Statements
2. Java If else Statements
3. Java if else if Statements
4. Java Nested If Statements
5. Java Switch Case Statement

Java Loop Statements, Java Control Flow, Java for loop, while loop, do while loop, enhanced for loop, and Java nested loop statements.

Looping in programming languages is a feature that facilitates the execution of a set of instructions/functions repeatedly while some condition evaluates to true.

We have four-loop structures in Java:

1. for loop
2. while loop
3. do while loop
4. enhanced for loop

Branching statements are used to transfer control from one point to another in the code Branching statements are defined by three keywords – break, continue and return

The break statement is used to stop the execution and comes out of the loop Mostly break statements are used in switch and in loops.

The continue statement is also the same as the break statement, the only difference is when the break statement executes it comes out from the loop, whereas the continue statement executes comes out from the loop temporarily.

The return statement is used in User-defined methods (methods with a return value) and the return statement must be always the last statement in the method.

--------------------------------------
Three type of conditions in Computer programming.

1. Single Condition (Positive/Negative)
2. Compound/Multi Condition (Positive/Negative)
3. Nested Condition (Positive/Negative)
Рекомендации по теме
Комментарии
Автор

Thank you for that well-explained lesson. Anyway, you can make a video explaining how to automate actual Functionality testing. As if you were to do it on an actual project.

WebDesign