Use of While:
Public classXunhuan { Public Static voidMain (string[] args) {//Loops inti=10; while(i>0){ if(i==8) {i--; Continue;//Culling} System.out.println (--i); if(i==5) Break;//termination}
Continue is the meaning of culling.
if (i==8) {
i--;
Continue;}
Refers to the elimination of i==8 in the circulating type
Break is the meaning of termination
if (i==5)
Break
It means that the loop stops working until five o'clock.
Do and use:
Public classXunhuan { Public Static voidMain (string[] args) {//Loops intI=0; System.out.println (); Do//Do Loop{System.out.println (i++); } while(I<10);//End of semicolon } }
The loop is started by do and ends with the last semicolon.
For use:
Public class Xunhuan { publicstaticvoid main (string[] args) {// loop For (int m=1;m>0;m++) { //forloop System.out.println ("m=" +m); }}}
Looping statements: Usage of While;do while;for