Depends on the situation.
If the conditions are mutually exclusive, use else . This will cause Java to fail to check any conditions after the found value is true.
If they are not mutually exclusive, then using an if list without others can lead to several cases.
In your case, with a return in each of them, the performance will be the same, since you will need to perform the same number of comparisons no matter what.
Alan geleynse
source share