switch Statement
switch(int expression){
case constant1:
statements1
case constant2:
statements2
. . .
case constantn:
statementsn
}
-
The value of the int expression is compared with constanti in turn. If constanti equals the value, execution starts from statementsi to statementn, unless break is encountered. Break courses a jump out of the switch body immediately.