They contain the keyword if , followed by a boolean test, followed by either a single statement or a block statement to execute if the test is true. An optional else keyword provides the alternative statement to execute if the test is false. The argument to a switch statement must be a byte, char, short or int and must be a constant or constant expression. It takes only one argument. If none of the cases match, and there is no default case, the statement does nothing.
Loops are of two forms.
It may never execute it if the condition is false. Therefore, the code in the block may never be executed. If you have a loop index variable to keep track of how many times the loop has occurred, this expression might declare and initialize it. Boolean expression that tests the loop control variable. If the outcome of that test is true, the loop executes.