Learn to program Java Learning Do...while released, welcome through xuebiancheng8.com to visit
The previous analysis of Java's Process control is divided into select structure, loop structure, wherein the loop structure is divided into while,do...while and for loop
The following is an analysis of the do...while loops in the loop structure
The do...while is similar to the while loop and can also be used for looping operations.
And look at that.
Now to do 10,000 i++ operation what to do, to use the Do...while cycle is so implemented
do{
System.out.println (i);
i++;
}while (i<10000);
The above example is to use the Do...while loop, can help us to print 10,000 times I value, while performing 10,000 i++ operation.
The following is an analysis of the syntax of Do...while
bo=
Cyclic operation;
}while (cyclic conditions);
Do...while loop is characterized by the first execution once, after the execution of a time to judge the conditions, meet the conditions and then execute, not meet the conditions to end, in other words, do...while and while the difference is that while the first judgment after execution, and Do...while to execute at least once.
When the do...while is suitable for at least one time and the number of cycles is not fixed, it is recommended to use a for loop when the number of loops is fixed.
Please visit xuebiancheng8.com for details. The specific URL is
Http://xuebiancheng8.com/play/goodgoodstudy_60_daydayup.html