Branching in Java

Source: Internet
Author: User

Conditional Statements:    IF-ELSE Select structure:        if (conditional block) {            code block 1  &N Bsp    }else{            code block 2       }    Multiple If selection structure: &nbs P    IF-ELSE Select structure:        if (conditional block) {            code block 1  &N Bsp    }else if (condition block 2) {            code block 2       }else{            code block 3       }if-else when one of these conditions is met, the remaining judgment is no longer executed if the outer if judgment is executed by the nested IF. will then execute internal if judgment switch SELECT statement:    switch (expression) {            case value:      &NB Sp         code block 1                break;            Case Value:                code block 2          &NBSP ;     BREAK;&NBSp           default:                break;    &NB Sp  }switch When entering process Control, a block of code that matches num to the value of the case is executed if the match is not written, after the matching succeeds, the code after each case is executed until it encounters a break and then jumps out of switch, if a break is written, After the match succeeds, the code in the corresponding case is executed, and the break expression must be int or string type

Branching in Java

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.