/* for loop nested for loop

* /

public class ForTest06 {

public static void main(String[] args){ for (int i=1; i<=10; I++) {// the loop body can write other control statements // the control statements can be nested // the control statements can be: if, if... Else, switch, for, while, do... while /* if(){ for(;;) { while(){ if(){ for(;;) {}}}}} */ // it is best not to think too much, the body of the loop is a for loop, do not special this for, is just a normal for loop // is just a piece of code that conforms to Java syntax // inner loop, the variable name of the inner loop and the variable name of the outer loop cannot be the same. /* for(int i=100;;) { } */ //System.out.println("i -->" + i); for(int j=0; j<3; j++){ System.out.println("j-->" + j); }} // This is the body of the loop, and no matter what code is written in the body of the loop, this pile of code needs to be executed 10 times. for(int i=0; i<10; i++){ for(int j=0; j<3; j++){ System.out.println("j-->" + j); }} for(int I =0; i<10; i++){ for(int j=0; j<3; j++){ for(int k=0; k<3; k++){ System.out.println("k-->" + k); //30 012}}}}Copy the code

}