header-logo.png GKINDEX

Java while loop

While loop almost similar to the for loop but slight difference is, if you don't know how many iterations should go. In this case while loop is suggested to use, the best example for the while loop is iterating through collections(We can see more about collections in upcoming chapters).

Java while loop example

While loop almost similar to the for loop but slight difference is, if you don't know how many iterations should go. In this case while loop is suggested to use.
  • Share