while statement, do-while and for loop introduction

1while statement and do-while statement

   while first determine whether the conditions are re-entering the loop.

   do-while loop is to be over and then determine whether the conditions under once again decide whether to enter the loop

   while loop structure:

    while (determination condition) {

         Loop

}

 do- while loop structure:

  do{

        Loop

} While (determination condition);


2 Key for loop

  for (Expression; Analyzing; expression) {

        Loop

}

for loop execution order

   1-2-4-3,2-4-3,2-4-3,2 conditions are not satisfied out of the loop strip

        1            2    3

for(int i=0;i<10;i++){

         4

     System.out.println("i="+i);

}


Variable scope question:

  Scoped variables in the current of a large pair of parentheses effectively out of the braces are not accessible to the








Guess you like

Origin blog.csdn.net/weixin_40873693/article/details/78482820