Java Process Control

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.