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