Home / Java Tips Generated By ChatGPT / Loops – For Loop in Java Use for loops for iterating a set number of times. Source Code for(int i = 1; i <= 5; i++) { System.out.println(i); }