The statements which can be executed for specified set of times until the given condition satisfies are known as conditional controlled statements. In programming language loops are used to execute a set of statements repeatedly until a particular condition is satisfied.
Sequence of statement is executed until a specified condition is true. This sequence of statements to be executed is kept inside the curly braces { } known as loop body. After every execution of loop body, condition is checked, and if it is found to be true the loop body is executed again. When condition check turns out to be false, the loop body will not be executed.
There are three types of loops in java language
1. while loop
2. for loop
3. do-while loop
No comments:
Post a Comment