Which of the following constructions is proper, ex.1:
if(condition1){
//instruction to follow
} else if (condition2){
//instruction to follow
} else if (condition3) {
//instruction to follow
} else {
return;
}
or ex.2:
if(condition1){
//instruction to follow
} else if (condition2){
//instruction to follow
} else if (condition3){
//instruction to follow
}
The actual question is whether "if...else if" condition structure always needs to ends with "else" (ex.1) even if there is no such logical requirement or sometimes it can be free from that(ex.2)