+ 1
how to use else if and switch
4 Answers
+ 1
switch is an alernative for else if statement. But switch is fast in execution compared to else if. when you need to select an option among many then use switch.
0
if(test){
code
}else{
code
}
0
switch is an alternative for if statement
0
switch is a multi conditional statement where you can put up many conditions but in if .. else you cannot put many conditions