From 1282227c24d36cfc0a3e5bbd2f8494cf09898d45 Mon Sep 17 00:00:00 2001 From: Aaditree <43510617+Aaditree@users.noreply.github.com> Date: Fri, 15 Mar 2019 23:51:30 +0530 Subject: [PATCH] Infinite loop, fixed iteration (#29697) --- guide/english/java/loops/while-loop/index.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/guide/english/java/loops/while-loop/index.md b/guide/english/java/loops/while-loop/index.md index bc3e9e8863..f99b381fd9 100644 --- a/guide/english/java/loops/while-loop/index.md +++ b/guide/english/java/loops/while-loop/index.md @@ -3,7 +3,10 @@ title: While Loop --- # While Loop -The `while` loop repeatedly executes the block of statements until the condition specified within the parentheses evaluates to `false`. For instance: +The `while` loop repeatedly executes the block of statements until the condition specified within the parentheses evaluates to `false`. +It is usually used when the number of iterations is not fixed. + +For instance: ```java while (some_condition_is_true) @@ -37,4 +40,6 @@ Output: iter_While Value: 10 ``` +An infinite while loop is created when the loop remains true infinitely , maybe because there is no change in the change in value of the condition or it never turns false. + ![:rocket:](//forum.freecodecamp.com/images/emoji/emoji_one/rocket.png?v=2 ":rocket:") [Run Code](https://repl.it/CJYj/0)