talking about java performance .. what is better? if..else or multiple simple if
if( condition ) {
some_code;
return value;
}
else if( condition ) {
so
I'm confident a single if would be better, because whenever a true condition is encountered, it can safely skip the other else alternatives since they won't be executed. If you used multiple ifs, all the subsequent conditions would have to be evaluated anyway (even if, like I think you're supposing, they would be mutually exclusive).