Judging structure
if (conditional expression) {EXECUTE statement}
Do not execute when conditions are not established
if (conditional expression) {EXECUTE Statement 1}else{EXECUTE statement 2}
Execute statement 1 When condition is established, EXECUTE statement 2 when condition is not established
if (conditional expression 1) {EXECUTE statement 1}else if (conditional expression 2) {EXECUTE statement 2}else{EXECUTE statement 3}
Condition 10% immediately executes statement 1, does not set up a conditional expression 2, the condition 20% immediately executes statement 2, does not establish the execution statement 3
if (conditional expression 1) {if (conditional expression 2) {EXECUTE statement 2}else{EXECUTE statement 3}}else{EXECUTE statement 1}
When the condition is not true, execute statement 1, start conditional expression 2, condition 20% immediately execute statement 2, EXECUTE statement 3 when not established
Select structure
Switch: (expression) {case "value 1": Execute statement 1;break; case "Value 2": Execute statement 2;break; Default: Execute statement 3;break;}
Loop structure
for (initialize expression; loop condition expression; post-loop expression) {EXECUTE statement]
Meet the conditions to cycle
while (conditional expression) {EXECUTE statement}; condition-only loop
do{executes the statement}while (conditional expression), regardless of whether the condition satisfies at least once
Key words:
Break jumps out/terminates the loop, no longer loops equal to the condition of the secondary and subsequent loops
Continue skips the loop that is currently on the back of this loop
Java Process Control