Understanding loop structures is crucial for performing repetitive tasks. The for loop is one of the most common looping structures.
Source Code
for (int i = 0; i < 5; i++) {
System.out.println("i is: " + i);
}
Use a for loop when you know how many times you want to iterate.