The original understanding of continue stays on the surface, roughly thinking that
After executing this statement, the system returns to the iteration header (which is considered to be an import part). I did not expect that there are huge details.
For example: public class test ...{
/***//**
* @ Param ARGs
*/
Public static void main (string [] ARGs )...{
// Todo auto-generated method stub
Int K = 0;
Do ...{
K ++;
If (k <10 )...{
System. Out. println ("do-while:" + k );
Continue;
}
} While (k> 10 );
While (k <10 )...{
System. Out. println ("while:" + k );
If (k <10 )...{
K ++;
Continue;
}
}
For (INT I = 0; I <10; I ++ )...{
System. Out. println ("for:" + I );
If (I <10 )...{
Continue;
}
}
}
}
Returned results:
Do-while: 1
While: 1
While: 2
While: 3
While: 4
While: 5
While: 6
While: 7
While: 8
While: 9
For: 0
For: 1
For: 2
For: 3
For: 4
For: 5
For: 6
For: 7
For: 8
For: 9
Visible:
Do-while (EXC ):
Do -->... --> continue-(skip part of the Code)-> while (EXC) -->...
While (EXC ):
While (EXC) -->... --> continue-(direct)-> while (EXC) -->...
For (A; B; c ):
A --> B -->... --> continue-(direct)-> C --> B -->...