Traditional Culture Encyclopedia - Traditional stories - Three kinds of loop control statements in java process control statements
Three kinds of loop control statements in java process control statements
These are for loop, while loop and do…while loop.
For loop, such as for(int? I = 0; I<5; i++){ }; Cycle from 0, add 1 at a time, and end at 4.
While loop, such as while (true) {}; That is, when the condition is true, it will be executed, otherwise it will not be executed at one time.
Do…while loop, such as do {I = 0;; system . err . println(I)} while(I & gt; 1){}; In this case, even if the conditions are not met, the statements in do will be executed, which is suitable for the difference between while.
Remarks: The specific cycle can be selected according to actual needs.
- Related articles
- How to Write a Survey Report
150 points! - Tomb-Sweeping Day is both a solar term and a festival. What is its cultural connotation?
- How to do a good job in channel sales?
- Kindergarten flower arrangement activity program
- In what order is Bian Que's treatment written?
- What are the advantages of charcoal hot pot compared with ordinary hot pot?
- Tracing the history of Moutai brewing technology
- Introduction of prairie rickets
- The main raw materials of snail powder
- Xiamen City, special funds for the development of arts and culture funded projects staged one after another Ancient non-legacy meets the young generation