nested loop for *** java code example
Example 1: nested for loop in java
// outer loop
for (int i = 1; i <= 5; ++i) {
// codes
// inner loop
for(int j = 1; j <=2; ++j) {
// codes
}
..
}
Example 2: java nested for loop
for (int i = 0; i < 10; i++) {
for (int j = 0; j < 10; j++) {
System.out.println("*");
}
System.out.println("");
}