What is a cyclic structure? What are the elements?
Loop structure refers to code that can be executed repeatedly
Elements: 1, keywords, 2, to be repeatedly executed code; 3, Loop end condition.
What are the loop statements that can be implemented? What types can be divided into?
1, while 2, Do/while 3, for
Prior loop (while), posterior loop (do/while)
What does the while loop need to be aware of?
While loops can be executed 0 or more times. If the condition in the start part of the loop is not true, the loop code can never be executed.
How do I count the number of cyclic executions?
An integer variable is declared outside the recirculation body and initialized to 0;
In the loop, the increment of the variable is calculated, and the end result is the number of cycles.
What is the execution process of the Do/while statement?
Do/while can be executed 1 or more times. The loop code executes at least once, regardless of whether the condition of the judgment part behind the loop is true, and then determines whether the condition of the continuation loop is met.
What do I need to be aware of when do/while statements are used?
Do is a Java keyword and must be used in conjunction with while;
The Do/while loop is started by do and ends with a while: it must be: the ";" After the second while (expression) cannot be lost, he represents the end of the Do/while statement;
The expression in parentheses after the while is used for conditional judgment and determines whether the loop body executes;
The loop body after do can be a statement that executes, and a compound statement that can consist of multiple statements.
What is the difference between a break statement and a continue statement?
The break statement executes the end of the entire module, continue statement execution ends with the statement before continue in the module, followed by a statement exclusion.
2016.1.19 Learning Summary (while, do/while, break, continue)