Infinite While Loop In Java
Chapter:
Control Statements
Last Updated:
10-06-2016 12:36:15 UTC
Program:
/* ............... START ............... */
public class JavaInfiniteWhile {
public static void main(String args[]) {
int i = 10;
while (i > 1) {
System.out.println(i);
i++;
}
}
}
/* ............... END ............... */
Output
Notes:
-
Infinite while loop will never end . This is because condition which would always be true as we are incrementing the value inside while loop.
Tags
Infinite While Loop, Java