Loop in Java.

Loop in Java

  • Loop is a part of control flow statements.
  • To run the particular block of code continuously until a required condition is fullfil is called looping.
  • Loop is used when there is a need to execute a part of program multiple times.
 
  • There is a control variable, called the loop counter.
  • The control variable must be initialized; in other words, it must have an initial value.
  • The increment/decrement of the control variable, which is modified each time the iteration of the loop occurs.
  • The loop condition that determines if the looping should continue or the program should break from it.
Next Post Previous Post
No Comment
Add Comment
comment url