Java Lesson 5 – Loops
A cool feature in many programming languages is the ability to repeat code over and over. A common use for loops can be found in games. Games have an infinite loop that updates the game with new information, clears the screen, then redraws the game components using new information.
There are three different types of loops in Java. These consist of the for loop, the while loop, and the do-while loop.
The For loop