Why we use if, else if instead of multiple if block if the body is a return statement
<p>I am always in the habit of using if, else-if statement instead of multiple if statements. </p>

<p>Example:</p>

<pre><code>int val = -1;
if (a == b1) {
   return c1;
} else if (a == b2) {
   return c2;
} ...
...
} else {
   return c11;
}
</code></pre>

<p>How does it compare to example 2:</p>

<pre><code>if (a == b1) {
   return c1;
}
if (a == b2) {
   return c2;
}
....

if (a == b11) {
   return c11;
}
</code></pre>

<p>I know functionality wise they are the same. But is it best practice to do if else-if, or not? It's raised by one of my friends when I pointed out he could structure the code base differently to make it cleaner. It's already a habit for me for long but I have never asked why. </p>
