An if can be followed by an optional else block. The else block will execute if the Boolean expression tested by the if block evaluates to false. Following is the syntax. if(boolean_expression){ // statement(s) will execute if the Boolean expression is true. }
Read moreCan you put a switch case in a switch case?
Points to remember while using Switch Case There can be any number of case statements within a switch . Each case is followed by the value to be compared to and after that a colon.
Read more