#23 Known is a Drop! Nested for loop in JAVA with examples-

java dev.to

What is a Nested for Loop? A nested loop means: 👉 A for loop inside another for loop Outer loop → controls rows Inner loop → controls columns/repetitions inside each row Example 1: Print 1 1 1 1 1 1 1 1 1 1 public class NestedForLoop { public static void main(String[] args) { for(int row=1;row2;row++) { for(int column=1;column5;column++) { System.out.print(1+" "); } System.out.println(); } } } Output: 1 1 1 1

Read Full Tutorial open_in_new
arrow_back Back to Tutorials