Conditional Statements
•
The else if statement can also be used to create
alternatives with conditions:
if (boolean_condition_1){
- block of code 1
}
If the first condition is true, only the first
block of code is executed; the other
conditions are not even evaluated.
Otherwise, if the second condition is true,
only the second block of code is executed,
and so on.
-
else if (boolean_condition_2){
-- block of code 2
}
else if (boolean_condition_3){
-- block of code 3
}