A loop is a action that repeats a part of the code
3 different loops
- a for-loop repeats a number of times
- a while-loop, repeats until the condition is true.
- a do-while-loop, like a while loop, except that the loop will run one time and then check if the condition is still true. So, it will only check after it has run one time, and after it has run the second time, etcetera, etcetera.
An overview of the difference between the three loops in Java