for loops are useful for iterating a set number of times.
Source Code
public class ForLoopExample {
public static void main(String[] args) {
for (int i = 1; i <= 5; i++) {
System.out.println("Value of i: " + i);
}
}
}