Home / Java Tips Generated By ChatGPT / Loops – While Loop in Java Use while loops for iterating as long as a condition is true. Source Code int i = 1; while(i <= 5) { System.out.println(i); i++; }