next up previous contents
Next: For loops Up: RHUL Department of Physics Previous: Logical operators   Contents

3 Iteration

One of the most common and powerful ways to control the flow of execution through a program is by using iteration, also known as loops. A loop is just a way of telling the computer to repeat some code many times. The number of iterations can be fixed, or depend on the outcome of calculations made within the loop.

There are several types of loop available in Java. The first to be introduced is called a for loop.



Subsections

RHUL Dept. of Physics