Computer Science

Write short notes on Looping statement

Java Iterative Stmts

32 Likes

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:

  1. 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.
  2. 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.

Answered By

9 Likes


Related Questions