KnowledgeBoat Logo

Computer Science

Distinguish between:

Finite loop and Infinite loop

Java Iterative Stmts

18 Likes

Answer

Finite loopInfinite loop
It iterates for a finite number of iterations.It continues iterating indefinitely.
Example:
int i = 1;
while(i <= 10) {
  System.out.println(i);
  i++;
}
Example:
int i = 0;
while(i <= 10) {
  System.out.println(i);
}

Answered By

8 Likes


Related Questions