Computer Science
Answer
Looping statements are used to repeat a single statement or a set of statements as long as the desired condition remains true. There are two types of looping statements in Java:
- Entry-Controlled Loops
An entry-controlled loop checks the condition at the time of entry. Only if the condition is true, the program control enters the body of the loop. for and while loops are entry-controlled loops. - Exit-Controlled Loops
An exit-controlled loop checks the condition after executing its body. If the condition is true, loop will perform the next iteration otherwise program control will move out of the loop. do-while loop is an exit-controlled loop.
Related Questions
What is meant by statement? Name the different types of statements which are used in Java programming.
Write short notes on Control statement
What is the purpose of default in a switch statement? Explain with the help of an example.
What are the different ways to input the values in a Java Programming? Name them