talking about java performance .. what is better? if..else or multiple simple if
if( condition ) {
some_code;
return value;
}
else if( condition ) {
some_code;
return value;
}
else if( condition ) {
some_code;
return value;
}
else {
some_code;
return value;
}
or
if( condition ) {
some_code;
return value;
}
if( condition ) {
some_code;
return value;
}
if( condition ) {
some_code;
return value;
}
some_code;
return value;
Interested in your thoughts
Thnx !
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…