The term of use is this:
If you have multiple independent logics which is used for non-related restrictions or actions upon the condition then you can use multiple if
statement separately:
if(conditionA){
// do what suppose to do
}
if(conditionB){
// do what suppose to do
}
.
.
.
If you want one of the conditions you made to apply then you should use if else
or if else if
statemnets:
if(conditionA) {
// do what suppose to do on conditionA
} else {
// do what suppose to do if the conditionA doesn't satisfied.
}
if(conditionA) {
// do what suppose to do on conditionA
} else if(conditionb) {
// do what suppose to do on conditionB
} else {
// do what suppose to do if non of the conditions were satisfied.
}
By the way if you want to use if else if
chain it's better to use switch case
statements:
switch(true){
case conditionA:
// do what suppose to do on conditionA
break;
case conditionB:
// do what suppose to do on conditionB
break;
default:
// do what suppose to do if non of the conditions were satisfied.
}